wicked_pdf: Error: PDF could not be generated! Command Error: Loading pages (1/6)
Issue description
I am running a rails 6 app, using last version of wicked_pdf (2.1.0) and wkhtmltopdf-binary (0.12.6.5).
I needed to reinstall everything because I installed a new SSD drive, so I wanted to start fresh, a clean and fresh install.
I installed everything, everything works fine until I got this
RuntimeError (Failed to execute:
["/home/tom/.rbenv/versions/2.6.3/gemsets/migrante-arc/bin/wkhtmltopdf", "--encoding", "UTF-8", "--lowquality", "file:////tmp/wicked_pdf20201111-111564-fn71lx.html", "/tmp/wicked_pdf_generated_file20201111-111564-9g9y4j.pdf"]
Error: PDF could not be generated!
Command Error: Loading pages (1/6)
):=============================> ] 50%
If I run the command “outside” rails, it works, as described here: https://github.com/zakird/wkhtmltopdf_binary_gem/pull/99
I installed wkhtmltopdf from my distro repos (apt install wkhtmltopdf
), in order to set exe_path: /usr/bin/wkhtmltopdf
, and it works without any errors, as expected.
What am I missing? 😦
Expected or desired behavior
Get no errors (no RuntimeError)
System specifications
wicked_pdf gem version (output of cat Gemfile.lock | grep wicked_pdf
):
wicked_pdf (2.1.0)
wicked_pdf
wkhtmltopdf version (output of wkhtmltopdf --version
):
-
using rbenv and ruby 2.6.3: wkhtmltopdf 0.12.6 (with patched qt)
-
output from
/usr/bin/wkhtmltopdf -- version
(Debian unstable package version): wkhtmltopdf 0.12.6
whtmltopdf provider gem and version if one is used: wkhtmltopdf-binary 0.12.6.5
platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar): Debian unstable (sid)
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 2
- Comments: 18
Ok, that at least narrows it down to definitely not being a wicked_pdf issue. I do suspect it has something to do with an incompatibility between your system and the binary provided with the
wkhtmltopdf
gem you are using.It could be an issue with QT, but could also be something with libpng or fonts or something like that. I did a web search for “wkhtmltopdf floating point exception” and turned up a few links worth investigating. It seems to be CSS related.
If that doesn’t help, I’d recommend a removing things until it runs without issue to narrow down what’s going on. Maybe remove all styling first. If that fixes things, add back half, and keep doing it until you’ve zeroed in on the issue.