Convert HTML to PDF using Aspose.PDF for .NET - add bookmarks on indexes of HTML


I am converting an HTML file into pdf format. I have location indexes for html file on which i want to add bookmarks. These are actually the headings in the document, not the pages.
How I can achieve this goal?

Thanks for any help on this.



Kindly send us a sample HTML document along with an expected output PDF document. We will investigate your scenario and share our findings with you.

Please find attached zipped folder containing:

  1. Document.html: Source document which is converted into pdf format
  2. Result.pdf: Expected pdf output with bookmarks
  3. IndexesInformation.xls: This sheet contains information of html indexes we have with us to add bookmarks. A ‘summary’ sheet is given to explain column purpose, while data is given in ‘information’ sheet.

Let me know in case of any concern.
Thanks (119.7 KB)


In order to add the Bookmark or child Bookmark, you need to input the page number, horizontal width scale and vertical height scale. The Destination member of the OutlineItemCollection instance, helps to achieve this. There is no way to find the position with Section start/end indexes. However, if you cannot input the page number, then you can search Heading name string and retrieve its page number with the Page property of the TextFragment class. Please refer to these help topics: Add and Delete a Bookmark and Search and Get Text from Pages of a PDF Document