OutlineItemCollection not correctly saving

I am attempting to create an outline for a PDF and I am encountering an issue.

Document doc = new Document();
doc.Pages.Add();
doc.Pages.Add();

doc.Outlines.Add(new OutlineItemCollection(doc.Outlines));
doc.Outlines.Last.Title = “Page 1”;
doc.Outlines.Last.Action = new GoToAction(doc.Pages[1]);

doc.Outlines.Add(new OutlineItemCollection(doc.Outlines));
doc.Outlines.Last.Title = “Page 2”;
doc.Outlines.Last.Action = new GoToAction(doc.Pages[2]);

doc.Save(“out.pdf”);

Using this code, the titles are being generated correctly in the output, however, the GoToAction is not working. The GoToActions are working when I use the following code:
Document doc = new Document();
doc.Pages.Add();
doc.Pages.Add();

OutlineItemCollection outline1 = new OutlineItemCollection(doc.Outlines);
outline1.Title = “Page 1”;
outline1.Action = new GoToAction(doc.Pages[1]);
doc.Outlines.Add(outline1);

OutlineItemCollection outline2 = new OutlineItemCollection(doc.Outlines);
outline2.Title = “Page 2”;
outline2.Action = new GoToAction(doc.Pages[2]);
doc.Outlines.Add(outline2);

doc.Save(“out.pdf”);


Hi John,


Thanks for your inquiry. After initial investigation, we have logged the issue as PDFNEWNET-36000 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue progress via this forum thread.

We are sorry for the inconvenience caused.

Best Regards,

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.