Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on wkhtmltopdf 0.12.6 #79

Open
benonymus opened this issue Jan 27, 2021 · 4 comments
Open

Issue on wkhtmltopdf 0.12.6 #79

benonymus opened this issue Jan 27, 2021 · 4 comments

Comments

@benonymus
Copy link

benonymus commented Jan 27, 2021

Hey,
I updated to wkhtmltopdf 0.12.6 and there seems to be this problem:
wkhtmltopdf/wkhtmltopdf#4926
or this
https://stackoverflow.com/questions/62315246/wkhtmltopdf-0-12-6-warning-blocked-access-to-file

The solution would be to pass the --enable-local-file-access flag, I tried to pass it as shell params but doesn't seem to work.

How should I pass it?

I am getting after some tweaking:

(MatchError) no match of right hand side value: {:error, {:generator_failed, "Loading page (1/2)\n[> ] 0%\r[==============> ] 24%\r"}}

The original full error is the following:

(MatchError) no match of right hand side value: {:error, {:generator_failed, "QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'\nLoading page (1/2)\n[> ] 0%\r[======================> ] 37%\rWarning: Blocked access to file /tmp/qr_business_order_nEQx8vpXgWDbXAmN.png\nError: Failed to load about:blank, with network status code 301 and http status code 0 - Protocol "about" is unknown\n"}}

I fixed the XDG_RUNTIME_DIR part by setting it as an env var, and i fixed the 301 by not writing images to files and loading them, but rather passing them as base64 to the template.

The last piece is the error on the top, that I think the flag could fix, the flag might have fixed it all.

@zivaskovic
Copy link

Did someone solved this problem?

{:error, {:generator_failed, "Loading page (1/2)\n[> ] 0%\r[==============================> ] 50%\r"}}

@benonymus
Copy link
Author

benonymus commented Feb 11, 2022 via email

@drKreso
Copy link

drKreso commented Feb 11, 2022

apk add ttf-liberation

On Alpine linux helped me. Missing fonts gave segfault.

@tfwright
Copy link

Missing fonts gave segfault.

I was getting the same opaque error @zivaskovic mentions and adding the font to my docker file fixed the issue for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants