We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to get page number from an Acrobat bookmark?

Thread ID:

Created:

Updated:

Platform:

Replies:

114471 Nov 20,2013 12:26 PM Nov 1,2016 04:58 AM Windows Forms 8
loading
Tags: PDF
Alex Colleoni
Asked On November 20, 2013 12:26 PM

Hi,
i need to extract from a PDF file a list of all bookmark.
For each bookmark i also need to know the page number of the destination page.
I can iterate through all bookmark an get the title and the destination page object (PdfPage type), but i don't know how to get the page number from the "PdfPage" object.

I hope someone can help me.



Praveenkumar H [Syncfusion]
Replied On November 25, 2013 12:17 AM

Hi Alex,

Thank you for using syncfusion products,

We don't have the direct support to get the page number of the destination page.
However we have created the workaround sample for you.
The sample is attached for your reference.

With Regards,
Praveen


Bookmark_Pagenumber_c5467291.zip

Alex Colleoni
Replied On December 3, 2013 12:17 PM

Hi,
thank you really much for your reply. While i was waiting for your answer i solved the problem using almost the same code you send me. I was not sure it was the best method, but now you answer me i know i can use it without problem.

Thank you again,
i really appreciate your answer.
Alex


Praveenkumar H [Syncfusion]
Replied On December 5, 2013 04:29 AM

Alex,

Thank you for your reply,

We are happy to hear that you got the solution for the problem.

Please let us know if you need further assistance.

With Regard,
Praveen

Zander Westendarp
Replied On October 30, 2016 05:25 PM

Hi Alex,

Thank you for using syncfusion products,

We don't have the direct support to get the page number of the destination page.
However we have created the workaround sample for you.
The sample is attached for your reference.

With Regards,
Praveen


Bookmark_Pagenumber_c5467291.zip

I have the same need, and cannot find the "sample attached for your reference" mentioned in Praveenkumar's reply. The link Bookmark_Pagenumber_c5467291.zip fails. 

Can someone please re-post the sample code? 

Many thanks!
"

Zander Westendarp
Replied On October 30, 2016 06:06 PM

Never mind...I figured it out. I created a Dictionary, each entry consisting of a PdfLoadedPage object as the key, and an integer counter as the value.
It's then easy to get a bookmark's page and look up its page number in the dictionary. 

Chinnu Muniyappan [Syncfusion]
Replied On October 31, 2016 06:01 AM

Hi Zander, 
 
Thank you for your update. You can refer the working sample from the below KB link 

Regards, 
Chinnu 


Zander Westendarp
Replied On October 31, 2016 04:52 PM

Thanks, Chinnu
Using a Dictionary as a lookup table is more efficient that looping through all of the document pages for each bookmark, as suggested by the KB. ;)


Chinnu Muniyappan [Syncfusion]
Replied On November 1, 2016 04:58 AM

Hi Zander, 
 
Thank you for your update. We will also include your solution in our existing KB sample as per your suggestions. 
 
Regards, 
Chinnu 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;