V13 PDF files from dev and live site is not giving same result

Hi all,

need some clarification regarding PDF output.

So I have made some amendment from back end site for process statement of account.
When we click Download button, it should be able to download the PDF.
From dev site, the result is beautiful and as expected.
Font size is okay, page break is working, etc.

But when we try to implement into Live site, it does not give the same output.
Font size no change, page break is not working.

  • we are running ERPNext: v13.33.0 (version-13)
  • Frappe Framework: v13.32.0 (version-13)
  • Checked on wkhtmltopdf version, both are same. (0.12.5)
  • Installed cups also no changes.

From dev site :



however, from live site :


is there any other way I can overcome/what things I should check for this ? What did I missed ?

v13 uses a pdf generator called wkhtmltopdf. Itā€™s a nightmare to work with, and there are dozens of threads about it on this forum. The short answer is that wkhtmltopdf canā€™t access your css and other assets, likely due to a permissions or addressing issue.

Unfortunately, thereā€™s not much Frappe can do in the application space to solve this issue in the application space, as wkhtmltopdf is installed separate binary executable. Itā€™s an issue of server configuration. For what itā€™s worth, v14 has ditched wkhtmltopdf for weasyprint for exactly this reason.

2 Likes

Thankyou very much @peterg for the helpful info and feedback. Really appreciate it.
Look forward for the upcoming implementation, canā€™t wait to see how it will help us all in future. And thankyou to all team members for taking note and initiative and working hard to improve from time to time.

Stay safe and thank you once again.

Hey @peterg there still seems to be a dependency there for wkhtmltopdf in my v14 install. If I uninstall wkhtmltox and install weasyprint, I get this error. Do I need to configure anything to make the transition?

File ā€œenv/lib/python3.10/site-packages/pdfkit/configuration.pyā€, line 35, in init
with open(self.wkhtmltopdf) as f:
FileNotFoundError: [Errno 2] No such file or directory: bā€™ā€™

$ bench version
erpnext 14.2.3
frappe 14.10.0
hrms 1.0.0
payments 0.0.1

Hmm, Iā€™m not sure whatā€™s going on there. Itā€™s possible that weasyprint is used for some things and wkhtmltopdf is still used for others.