UserFiles.zip (136.3 KB)
contains a word file and two generated PDF files . One is generated using aspose (SimpleTestDoc.pdf) and other through MSWord.
If you check bookmarks from Word file they have starting point and endpoint as shown in screenshot below.
wordScreen.jpg (73.3 KB)
But when we check these bookmarks in Aspose converted PDF it is not showing bookmark End.
It is goving bookmark.PageDisplay_Right and bookmark.PageDisplay_Bottom as 0 always.
Below is the code we are using
Aspose.Pdf.Document document = new Aspose.Pdf.Document(“D:\temp\UserFiles\msw-2016.pdf”);
// Create PdfBookmarkEditor
PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor();
// Open PDF file
bookmarkEditor.BindPdf(document);
// Extract bookmarks
Aspose.Pdf.Facades.Bookmarks bookmarks = bookmarkEditor.ExtractBookmarks();
foreach (Aspose.Pdf.Facades.Bookmark bookmark in bookmarks)
{
Console.WriteLine(“Title: {0}”, bookmark.Title);
Console.WriteLine(“Bottom: {0}”, bookmark.PageDisplay_Bottom);
Console.WriteLine(“Top: {0}”, bookmark.PageDisplay_Top);
Console.WriteLine(“Left: {0}”, bookmark.PageDisplay_Left);
Console.WriteLine(“Right: {0}”, bookmark.PageDisplay_Right);
}