KSA Invoice pdf generation problem

Server Error
Traceback (most recent call last):
File “apps/frappe/frappe/utils/pdf.py”, line 37, in get_pdf
filedata = pdfkit.from_string(html, False, options=options or {})
File “env/lib/python3.9/site-packages/pdfkit/api.py”, line 72, in from_string
return r.to_pdf(output_path)
File “env/lib/python3.9/site-packages/pdfkit/pdfkit.py”, line 156, in to_pdf
raise IOError(‘wkhtmltopdf reported an error:\n’ + stderr)
OSError: wkhtmltopdf reported an error:
Exit with code 1 due to network error: ContentNotFoundError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 66, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 31, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 68, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “apps/frappe/frappe/init.py”, line 1252, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/utils/print_format.py”, line 93, in download_pdf
frappe.local.response.filecontent = get_pdf(html)
File “apps/frappe/frappe/utils/pdf.py”, line 46, in get_pdf
frappe.throw(_(“PDF generation failed because of broken image links”))
File “apps/frappe/frappe/init.py”, line 448, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File “apps/frappe/frappe/init.py”, line 427, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 382, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: PDF generation failed because of broken image links

I am facing the same issue in erpNext 14,
were you able to solve this issue?

This is not a error. I think you are trying to print or export to pdf when the document is in draft mode. The Qrcode creation happening when you submit the invoice. Try to submit and print the invoice. The error will disappear as the missing qrcode image generated.

1 Like