I have an issue where a generated PDF document contains a rotated document. The bookmarks are directed to the page after the rotated document in Chrome but directed to the correct page when opened in Adobe Acrobat.
I have added a sample PDF below.
I’m wondering if you have come across this before and have a fix?
Thanks for your reply.
Here is a snippet to recreate issue in Chrome with a rotated doc. I have attached
the example docs I Used also: Docs.zip (108.1 KB)
var firstPdf = new Document(@"Doc 1.pdf");
var secondPdf = new Document(@"Doc 2.pdf");
var rotatedPdf = new Document(@"RotatedDoc.pdf");
var thirdPdf = new Document(@"Preformatted textDoc 3.pdf");
var docsToAdd = new Document[] { firstPdf, secondPdf, rotatedPdf, thirdPdf };
for (int i = 1; i <= docsToAdd.Length; i++)
{
Aspose.Pdf.OutlineItemCollection bm = new Aspose.Pdf.OutlineItemCollection(brief.Outlines);
brief.Pages.Add(docsToAdd[i - 1].Pages[1]);
if (brief.Pages[i].Rotate == Rotation.None)
bm.Destination = new XYZExplicitDestination(i, 0, brief.Pages[i].MediaBox.Height, 0.0);
else if (brief.Pages[i].Rotate == Rotation.on270)
bm.Destination = new XYZExplicitDestination(i, brief.Pages[i].MediaBox.Width, 0, 0.0);
else
{
bm.Destination = new GoToAction(brief.Pages[i]);
}
bm.Title = docsToAdd[i - 1].FileName;
brief.Outlines.Add(bm);
}
brief.Save("Brief.pdf");
Unfortunately it is a requirement to get the bookmarks themselves working(Screenshot below). We have functionality in place that deals with the Table of content hyperlinks already.
I have had a look through the forum and also found this issue which seems to be related to mine:
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.