Include DPI parameter into PDF options

Hello,

I would like to propose the following feature request:

ERPNext: v12.16.2 (version-12)

Frappe Framework: v12.13.0 (version-12)

Problem description
The current implementation uses a default or hardcoded DPI setting for the PDF output (refer to the latest post in Wkhtmltopdf 0.12.3 SSL Errors on Debian 9 - #4 by itsdave). This leads to problems (e.g. character spacing and shape) with several fonts, that apparently need a higher DPI setting.

Current workaround
Right now, I added a line to the options defaults in the function “prepare_options” in frappe/pdf.py at develop · frappe/frappe · GitHub with a custom DPI setting (e.g. “dpi”: 300). This leads to a difference of the code to the production branch thus breaking “bench update”. I therefore have to restore the file before each update.

Proposed solution
Please add an option parameter like “page-size”, “orientation” or the margins for DPI. Using this parameter users could overwrite the default setting using the custom print formats thus leaving the code unchanged.

Best regards,
Uwe

3 Likes

Agree, would be great to have the dpi settable :+1:

I have a function in my backlog to add product specs to a quotation print, dpi would be very helpful

Has this been implemented yet? I’m having issues with image compression, so I thought setting the dpi to 300 might change the way the PDF generation compresses my png…

EDIT: It hasn’t really been the problem, as I haven’t used the proper link to the full-size image lol