Hi,
I am trying to add a parent bookmark to an existing pdf document and I am using following piece of code. But Adding parent bookmark does not point to first page of document. It either points to second page of document or it points to end of first page. How can I point it to the first page of document?
Aspose.Pdf.Document p = new Aspose.Pdf.Document("DocInput.pdf");
Aspose.Pdf.OutlineCollection rootBookmark = p.Outlines;
Aspose.Pdf.OutlineItemCollection newRootBookmark = new Aspose.Pdf.OutlineItemCollection(rootBookmark);
newRootBookmark.Title = "label";
newRootBookmark.Destination = new Aspose.Pdf.Annotations.FitHExplicitDestination(p.Pages[1], p.Pages.Count);
new FitHExplicitDestination(p.Pages[1], p.Pages.Count);
foreach (Aspose.Pdf.OutlineItemCollection bookmarks in rootBookmark)
{
newRootBookmark.Add(bookmarks);
}
p.Outlines.Delete();
p.Outlines.Add(newRootBookmark);
p.Save("DocOutput.pdf");
DocInput.pdf (1.7 MB)DocOutput.pdf (1.7 MB)