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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Navegation Menu C#
  FAQ FAQ  Forum Search   Register Register  Login Login

Navegation Menu C#

 Post Reply Post Reply
Author
Message
DanielDB View Drop Down
Beginner
Beginner


Joined: 03 Mar 14
Location: Mexico
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote DanielDB Quote  Post ReplyReply Direct Link To This Post Topic: Navegation Menu C#
    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


Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 14 at 8:18AM
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
Back to Top
DanielDB View Drop Down
Beginner
Beginner


Joined: 03 Mar 14
Location: Mexico
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote DanielDB Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 14 at 1:56PM
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).

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 14 at 2:37AM
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);
}

Back to Top
DanielDB View Drop Down
Beginner
Beginner


Joined: 03 Mar 14
Location: Mexico
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote DanielDB Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 14 at 4:02PM
Andrew , it was an excellent solution !!
thanks for share ur knowledge.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store