Embedded links in PDF output do not work when page numbering is enabled
What version of Invoice Ninja are you running? ie v4.5.25 / v5.0.30 v5.3.96
What environment are you running? Docker
Have you checked log files (storage/logs/) Please provide redacted output
Have you searched existing issues?
Have you reported this to Slack/forum before posting?
Describe the bug When invoice page numbering is enabled, embedded links in generated PDFs stop working.
Steps To Reproduce Select or modify a PDF invoice template that uses embedded links (such as the "Pay" or "View" links substituted by "$payment_button" and "$view_button" fields). Enable invoice page numbering ("Invoice Design" -> "General Settings" -> "Page Numbering" -> Select "Show"). No embedded links in generated invoice PDFs are now clickable.
Expected behavior Anyone viewing the PDF should be able to click on the generated link and have their browser open the relevant page (usually to view or pay the invoice). These links do work when page numbering is not enabled.
Screenshots
Additional context This bug is caused by FPDI being used to insert the page numbers into the PDF here. It is a known issue in FPDI, and not one they intend to fix.
It looks like this is caused by the manner in which FPDI rewrites the PDF into a format compatible with their templating system. Anecdotally, in my example this restructure also increased the size of my PDF by over 40% (with the same example invoice, turning page numbering on broke the links and increased the PDF size from 700KB to 1MB).
(v5) Can you replicate the issue on our demo site? https://demo.invoiceninja.com
Source: invoiceninja/invoiceninja