I adding one bookmark to the attached PDF as follows: (Aspose PDF 7.3)
Aspose.Pdf.License lic = new Aspose.Pdf.License();
lic.SetLicense(@“Aspose.PDF.lic”);
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(@“Test.pdf”);
Aspose.Pdf.OutlineItemCollection introBm = new Aspose.Pdf.OutlineItemCollection(doc.Outlines);
introBm.Title = “Page 3”;
introBm.Destination = new Aspose.Pdf.InteractiveFeatures.GoToAction(3);
doc.Outlines.Add(introBm);
doc.Save(@“Test-Bookmark.pdf”);
I note that when this PDF is subsequently opened and saved in Adobe Professional (without making any changes to the document) then the bookmark remains but it no longer works, i.e. it no longer opens the specified page.
I have also noted that when adding a document in Adobe Professional to a PDF generated using Aspose.PDF, then all bookmarks below the new document disappear.
Hi
James,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thank you for sharing the template file.
I am able to reproduce your mentioned issue
after an initial test regarding bookmarks are not retained after saving the
file using Adobe Professional (I used Adobe X for testing purpose). Your issue
has been registered in our issue tracking system with issue id:PDFNEWNET-34284 for rectification.You will be
notified via this forum thread regarding any updates against your issue.
We have further investigated this issue and have found that in order to correct this problem, please try using Action property of OutlineItemCollection instead of Destination. Please try using the following code snippet.
[C#]
Aspose.Pdf.Document doc = new
Aspose.Pdf.Document(@“D:\pdftest\Test_bookmarks.pdf”);<o:p></o:p>
Aspose.Pdf.OutlineItemCollection introBm = new Aspose.Pdf.OutlineItemCollection(doc.Outlines);
introBm.Title
= "Page 3";
//introBm.Destination = new
Aspose.Pdf.InteractiveFeatures.GoToAction(3);
introBm.Action
= new Aspose.Pdf.InteractiveFeatures.GoToAction(doc.Pages[3]);