To get the qt version I run the following commands:
1. sudo apt purge wkhtmltopdf -y
2. wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
3. sudo dpkg -i wkhtmltox_0.12.6-2.jammy_amd64.deb
at this point I got a libjpeg-turbo8 issue. Aparently libjpeg-turbo8 does not come with Debian 12
so I had to do the following
4. wget http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_2.1.5-2ubuntu2_amd64.deb
5. sudo dpkg -i libjpeg-turbo8_2.1.5-2ubuntu2_amd64.deb
6. sudo dpkg -i wkhtmltox_0.12.6-2.jammy_amd64.deb
7. sudo apt install -f
8. sudo reboot
to verify i did the following
wkhtmltopdf --version
wkhtmltopdf 0.12.6.1 (with patched qt)
then
wkhtmltopdf http://ft.com output.pdf
It worked!!!
However, now I have the following issue when printing anything
Traceback (most recent call last):
File "apps/frappe/frappe/utils/pdf.py", line 49, in pdf_body_html
return template.render(args, filters={"len": len})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/jinja2/environment.py", line 1304, in render
self.environment.handle_exception()
File "env/lib/python3.11/site-packages/jinja2/environment.py", line 939, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 19, in top-level template code
File "env/lib/python3.11/site-packages/jinja2/sandbox.py", line 392, in call
if not __self.is_safe_callable(__obj):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/jinja2/sandbox.py", line 276, in is_safe_callable
getattr(obj, "unsafe_callable", False) or getattr(obj, "alters_data", False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jinja2.exceptions.UndefinedError: '__' is undefined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 114, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/__init__.py", line 49, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/handler.py", line 49, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/__init__.py", line 1725, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/utils/print_format.py", line 234, in download_pdf
pdf_file = frappe.get_print(
^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/__init__.py", line 2136, in get_print
response = get_response_without_exception_handling("printview", 200)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/serve.py", line 47, in get_response_without_exception_handling
return renderer_instance.render()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/utils.py", line 530, in cache_html_decorator
html = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
self.update_context()
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
data = self.run_pymodule_method("get_context")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 223, in run_pymodule_method
return method(self.context)
^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/www/printview.py", line 56, in get_context
body = get_rendered_template(
^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/www/printview.py", line 227, in get_rendered_template
html = frappe.get_attr(hook_func[-1])(jenv=jenv, template=template, print_format=print_format, args=args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/print_designer/print_designer/pdf.py", line 86, in pdf_body_html
return fw_pdf_body_html(template, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/utils/pdf.py", line 52, in pdf_body_html
frappe.throw(
File "apps/frappe/frappe/__init__.py", line 602, in throw
msgprint(
File "apps/frappe/frappe/__init__.py", line 567, in msgprint
_raise_exception()
File "apps/frappe/frappe/__init__.py", line 518, in _raise_exception
raise exc
frappe.exceptions.PrintFormatError: Error in print format on line 19: '__' i
I am at a loss. Anything I try doesn’t seem to be working. I believe there is a serious issue with PDF in ERPnext that have yet to be resolved.
Can you help?