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:
- Document.html: Source document which is converted into pdf format
- Result.pdf: Expected pdf output with bookmarks
- 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.
ConversionWithBookmarks.zip (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