I’ve recently implemented a feature where we send html markup to an AWS lambda that uses wkhtmltopdf to generate pdfs. one of our pdfs uses a table of contents and I have not been able to get those links to work properly.
in case it helps, I am using wkhtmltopdf’s official binary in the lambda
After research for quite I a bit I’ve structured my links like so
<a href="#name-of-link">go to link</a>
<h1><a name="name-of-link">My Title</a></h1>
I also added the following arguments to my wkhtmltopdf call
--enable-internal-links
--keep-relative-links
result:
When I open pdf in Firefox, links are not clickable
When I open pdf in preview, links says “Preview will open this link in a different app”
Preview warning message
0