html2pdf.js
html2pdf.js copied to clipboard
Local Links don't work correctly
I'm trying to create a linked table of contents but when I set it up to link locally to the corresponding header tag, it links to the web page.
For example:
<div id="element-to-print">
<a href="#locallink">Local Link</a>
<p>
some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text
</p>
<h2>
<a name="locallink">Local Link</a>
</h2>
</div>
When the PDF is created in your JSFiddle it linked to: https://fiddle.jshell.net/_display/?editor_console=true%23locallink
I'm also trying to make a table of contents for a html2pdf-generated PDF doc, and would love it if the ToC items were clickable for navigating (the document is fairly long).
I did a little poking around in jsPDF to see if I could find anything about how to do this, but haven't come across anything yet. Hoping this functionality will be possible at some point!
Me too, whenever I add a link it this way it opens up in the browser or in a new tab, not in the current PDF file.
me three
I have the same question, has anyone found a solution?
Same issue