Gleb
Gleb

Reputation: 93

How to make a clickable link in pdf footer using wkhtmltopdf?

We want to use links in the pdf footer. We utilize wkhtmltopdf tool to generate our pdfs.

wkhtmltopdf wrongly places the clickable area few millimeters above the link itself bug screenshot

When we use absolute links in the footer like https://google.com pdf viewers recognize the links and allow to click on it enter image description here

But we would like to show custom text for our links like Terms and conditions and so on. As a possible workaround, we were trying to overlay our link text over a transparent link using absolute positioning (codepen). It works well for html but doesn't work for pdfs.

Do we have some other possible options to get around the issue?

Upvotes: 0

Views: 349

Answers (1)

Gleb
Gleb

Reputation: 93

We implemented a JS workaround where we duplicate footer content and move it down by 135px. So the footer replica is invisible to the end users but it provides clickable areas for the original footer. We could do it because we have constant top and bottom margins. enter image description here

Upvotes: 2

Related Questions