PDF generate issue on sales order page

Traceback (most recent call last):
File “/home/cis/Desktop/sapconproject/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.api.handle()
File “/home/cis/Desktop/sapconproject/frappe-bench/apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “/home/cis/Desktop/sapconproject/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/cis/Desktop/sapconproject/frappe-bench/apps/frappe/frappe/handler.py”, line 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/cis/Desktop/sapconproject/frappe-bench/apps/frappe/frappe/init.py”, line 922, in call
return fn(*args, **newargs)
File “/home/cis/Desktop/sapconproject/frappe-bench/apps/frappe/frappe/utils/print_format.py”, line 48, in download_pdf
frappe.local.response.filecontent = get_pdf(html)
File “/home/cis/Desktop/sapconproject/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 17, in get_pdf
pdfkit.from_string(html, fname, options=options or {})
File “/home/cis/Desktop/sapconproject/frappe-bench/env/src/pdfkit/pdfkit/api.py”, line 68, in from_string
return r.to_pdf(output_path)
File “/home/cis/Desktop/sapconproject/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py”, line 143, in to_pdf
raise IOError(“wkhtmltopdf exited with non-zero code {0}. error:\n{1}”.format(exit_code, stderr.decode(“utf-8”)))
IOError: wkhtmltopdf exited with non-zero code 1. error:
The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.Unknown long argument --background

Getting the same issue

Same here.

"wkhtmltopdf exited with non-zero code -6. error:
The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.The switch --print-media-type, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display "

wkhtmltopdf is already the newest version (0.12.3.2-3).
ERPNext: v10.x.x-develop (02a40e9) (develop)
Frappe Framework: v10.x.x-develop (947f409) (develop)

Also seeing a similar error on latest versions:
ERPNext: v11.1.33 (master)
Frappe Framework: v11.1.30 (master)

You need to update to 0.12.5.x

1 Like

This solves the issue