Closed thib44 closed 3 years ago
For info incase anyone is still having problems with this. I had run into a similar issue, rather than being an issue with this gem there was a breaking change with wkhtmltopdf in it's 012.6 release which now blocks local filesystem access by default.
To resolve the issue, you may want to look at the advanced options on the wicked_pdf gem and use enable_local_file_access
. More info in the docs.
Hope that helps!
Thanks for pointing this out. The work-around for wicked_pdf is to put it in your initializer like this:
WickedPdf.config = {
enable_local_file_access: true
}
Which should apply that command-line flag to all calls.
@unixmonkey That's right, in 0.12.6 version of wkhtmltopdf the filesystem access is blocked by default, but is possible to reactivate it by command-line flag, as mentioned by @unixmonkey and @bertiecroll .
So, I think we solved and the issue can be closed 🎉
When I try to display an image in a pdf, i've got a square, instead of the image. No problem with the '0.12.5.4' version, but the issue is with the upper versions. Example of code :
<%= wicked_pdf_image_tag 'logo_lifen_invoice.png' %>
And i'm using thepdf_from_string
method.