Kozea / WeasyPrint

The awesome document factory
https://weasyprint.org
BSD 3-Clause "New" or "Revised" License
6.84k stars 653 forks source link

Hyperlinks and page numbers not working in pdf #2188

Closed Dashrath158 closed 1 week ago

Dashrath158 commented 1 week ago

Hello to the folks at Weasyprint,

I have a Flask app where we use Jinja2 templates, and I have been encountering issues with page numbers and hyperlinks when exporting reports as PDFs. I followed the basic syntax for page numbers, but they do not show up in the PDF, and neither do the header or footer. As for the hyperlinks, I used an anchor tag to link to an ID of an element. However, when I click on that link in the PDF, I receive the following error: "Your file couldn’t be accessed. It may have been moved, edited, or deleted. ERR_FILE_NOT_FOUND."

I'm not sure if the internal linking functionality is not supported by Weasyprint yet, or if I'm missing something here. Any help you can provide would be greatly appreciated.

liZe commented 1 week ago

Hi!

I'm not sure if the internal linking functionality is not supported by Weasyprint yet, or if I'm missing something here.

Internal links work if you use anchors.

You should check that your generated HTML includes anchors for internal links, and not URLs to your development application.

Dashrath158 commented 1 week ago

Hey thanks for the help, the issue is now resolved. It wasn't an weasyprint issue just some misconfiguration in our merger util that caused the problem.