Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Navegation Menu C# |
Post Reply ![]() |
Author | |
DanielDB ![]() Beginner ![]() Joined: 03 Mar 14 Location: Mexico Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 03 Mar 14 at 4:14PM |
I´ve looking some sample to do this, but i didnt find it, i can load/open a pdf document and view it, but only open the first page, How to do to display the next pages of the document?
I have this code so far: string fileName = @"..\..\Test Files\test.pdf"; int pageNumber = 1; // Check to see if the library has been successfully unlocked if (qp.Unlocked() == 1) { // Open the file, get a file handle int fileHandle = qp.DAOpenFile(fileName); // Get a reference to the first page int pageReference = qp.DAFindPage(fileHandle, pageNumber); -------------- Thanks in advance |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
Daniel, This is the normal way. Pass you pageNumber into DAFindPage to get a new Handle for page 2. pageNumber = 2; pageRederence = qp.DAFindPage(fileHandle, pageNumber); Andrew |
|
![]() |
|
DanielDB ![]() Beginner ![]() Joined: 03 Mar 14 Location: Mexico Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Thanks AndrewC for your answer, but that method is no the best way to solve it, because i manage sometimes documents with 100 o more pages, i'll need put one arrow button for change each page, it must have a way to increment/decrement that value for navegate for all pages with only two arrow buttons( next page/previous page).
|
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
Daniel,
The problem is more of programming issue than a Debenu Quick PDF Library issue.
Put two buttons on your form called PrevPage and NextPage. And then use the following pseudo code to process the button presses to keep track of the currPage and update the image as required. int currPage = 1; int pageCount; string fileName = @"..\..\Test Files\test.pdf"; int fileHandle; buttonOpenPDFFile_Clicked() { // Check to see if the library has been successfully unlocked if (qp.Unlocked() == 1) { // Open the file, get a file handle fileHandle = qp.DAOpenFile(fileName); pageCount = qp.DAGetPageCount(fileHandle); } buttonPrevPage_Clicked() { if (Page > 1) { currPage = currPage -1; UpdatePage(currPage); } } buttonNextPage_Clicked() { if (Page < pageCount) { currPage = currPage + 1; UpdatePage(currPage); } } UpdatePage(int page) { // Get a reference to the first page int pageReference = qp.DAFindPage(fileHandle, currPage); DrawThePageToScreen(pageReference); } |
|
![]() |
|
DanielDB ![]() Beginner ![]() Joined: 03 Mar 14 Location: Mexico Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Andrew , it was an excellent solution !!
thanks for share ur knowledge.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store