Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.
Mon Aug 31, 2015 4:51 am
Can you please help me identify the existing page to which an existing Bookmark points to? I am able to find the page X and Y coordinates under the Location information but not the specific page number or object to which the Bookmark belongs. please help with this.
-
saikumarc
-
- Posts: 1
- Joined: Mon Sep 01, 2014 10:33 am
Mon Aug 31, 2015 9:13 am
Hello,
Thanks for your inquiry.
For your requirement, here is the code for your reference.
- Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(path + "5698//Bookmark.pdf");
PdfBookmarkCollection bookmarks = doc.Bookmarks;
if (bookmarks.Count > 0)
{
PdfDestination des = bookmarks[1].Destination;//get the second bookmark.
int pageNum = doc.Pages.IndexOf(des.Page)+1;//get the page number.
}
Best Regards,
Sweety
E-iceblue support team
-
sweety1
-
- Posts: 539
- Joined: Wed Mar 11, 2015 1:14 am
Wed Sep 02, 2015 10:06 am
Hello,
Have you tried the code?
Has your issue been resolved?
Thanks for your feedback.
Best Regards,
Sweety
E-iceblue support team
-
sweety1
-
- Posts: 539
- Joined: Wed Mar 11, 2015 1:14 am