Requirements
I need to convert some HTML pages to one PDF.
For example:
- Page1 - Cover Page
- Page2 - TOC Page
- Page3 - ContentA Page
- Page4 - ContentB Page
- Page5…
The Page2 - TOC Page contains a Content Page List. For example:
<ul>
<li>Page3 - ContentA Page</li>
<li>Page4 - ContentB Page</li>
<li>Page5 - ContentC Page</li>
</ul>
Question
How to add a page link to the ‘li’ elements so that I can jump to the content page in the final PDF? Or are there any other methods that can do the same thing?
Puppeteersharp Solution
I used puppeteer-sharp before because it will use Chromium to render the HTML during the conversion. So it can use something like <a href='#Page3-ContentA'>
and z-index
to implement this function. (Aspose also does not support the z-index property, it may be another feature request:sweat_smile:)
Asbose Possible Solution?
I know Asbose has the LocalHyperlink. Not sure whether can implement this by adding an invisible but still clickable LocalHyperlink(like CSS opacity + z-index combo) to my HTML wording(Page3 - ContentA Page) position. It is still very tricky because I need to hardcode the HTML element position in the C# code.