Hello! Can anyone help me with dowloading PDFs? Locally it works perfectly, it also get css styling, but in production (fly.io) I am having problems. I am using gems gem 'wicked_pdf'
and
gem 'wkhtmltopdf-binary'
.These are the logs in flyio of the problem
I would really appreciate help or other options on how to deal with pdfs!
First thing to try: find the block of lines in your dockerfile that start with:
# Run and own only the runtime files as a non-root user for security
And delete from that line to the next blank line. You are seeing a permission denied message, and I’m not sure what file wkhtmltopdf can’t access, but running as root should get past this problem.
If that works, the next thing is to either figure out what that file is, or accept running as root.
I was able to do it! It was configuring the correct path for production in the initializer, nonetheless now I have the problem that some css is taken into account when downloading the pdf but some other (color background of specific components are not). But the weird thing is that some css is being taken into consideration… Thanks!!
Take a look at print-color-adjust - CSS: Cascading Style Sheets | MDN
Since you are using webkit, also set -webkit-print-color-adjust
.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.