PDF bookmark page number issue

Hello, support team,

I'm seeing an issue where the bookmark PageNumber property is different than what's originally set. Please see attached sample solution.

The first button on the form generates the "AposeMerge.pdf" file, in the code I'm setting the bookmark action with page number 1, 3 and 5 for the 3 pdf files being merged.

The second button loads the "AposeMerge.pdf" file, and when retrieving the bookmark property, the PageNumber returned from the first bookmark is 0, where it should be 1.

For reference, I manually combined the 3 files using Acrobat, called "AcrobatMerge.pdf". The 3rd button loads this file and the PageNumber returned is 1, which is correct.

Am I doing anything wrong in creating the bookmarks or is this a bug?

Thanks,

Jian

Hi Jian,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.Pdf.

I am able to generate your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-34134 for further investigation and rectification. We will notify you via this forum thread regarding any updates against your issue.

Sorry for the inconvenience,

Any news on this? We’re seeing the same issue.

For a bookmark that is an XYZ destination (set externally by a PDF viewer), we see the .Destination property on the bookmark being something like “{2 XYZ 0 841.92 0}” where 2 is the (correct) page number.

However, for a bookmark that has a GoToAction that has been set from Aspose.PDF, we see the .Action.Destination property being something like “{0 Fit}” where the page number is 0 when it should be 1. In a viewer the bookmark goes to the correct page, so it appears only to be an issue with the reading in. We can work around it by adding 1 to the page number in the second case (but not the first), but it would be useful to know exactly when this effect will or won’t occur, and whether it can be made more consistent.

Thanks,

George

Hi George,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am afraid; the issue is not resolved at the moment. However, I have requested the development team to share an ETA regarding the resolution of the issue. As soon as I get a feedback, I will let you know via this forum thread. Also, I would request you to share the sample application and template file to help us test your issue as well to further test your issue.

Sorry for the inconvenience,

Hi Jian,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I have received a feedback regarding the ETA for the rectification of PDFNEWNET-34134. The issue is scheduled to be fixed during this month and as per plan the fix will be a part of our November 2012 release of Aspose.Pdf for .NET v7.5. You will be notified via this forum thread regarding any updates against your reported issue.

Sorry for the inconvenience,

Hi Jian,


Thanks for your patience.

The issue PDFNEWNET-34134 reported earlier has been resolved and its hotfix will be included in upcoming release version of Aspose.Pdf for .NET 7.5.0 which is planned to release in current week. Furthermore, its recommenced to use following code snippet when adding Bookmarks to PDF file.

[C#]

Document doc = new Document(…);<o:p></o:p>

OutlineItemCollection bookmark = new OutlineItemCollection(doc.Outlines);

bookmark.Title = "bookmark1";

/* bookmark.Action = new GoToAction(1); <-- use next line instead of this one. */

bookmark.Action = new GoToAction(doc.Pages[1]);

doc.Outlines.Add(bookmark);

doc.Save(...);

The issues you have found earlier (filed as PDFNEWNET-34134) have been fixed in Aspose.Pdf for .NET 7.5.0.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.