I am getting following error
Bad wkhtmltopdf's path: xvfb-run -- /usr/bin/wkhtmltopdf
If I run same command on Ubunutu 16.04 CLI pdf is generated
Could any one please help me on this..
Regards,
Varma
That message is coming from this line.
I'm guessing your config/initializers/wicked_pdf.rb looks something like this:
WickedPdf.config = {
exe_path: 'xvfb-run -- /usr/bin/wkhtmltopdf'
}
which is currently not supported, as there are checks that make sure that string is a valid path to an executable file.
There is a PR to address this, but I'm not yet sure the benefits outweigh the risks of removing valuable error messages, and want to tweak it a bit.
A good workaround would be to create a new executable stub something like this:
echo echo '#!/bin/bash
xvfb-run -- /usr/bin/wkhtmltopdf' > bin/wicked_pdf
chmod +x bin/wicked_pdf
and change your initializer to point to this new file
WickedPdf.config = {
exe_path: Rails.root.join('bin', 'wicked_pdf').to_s
}
Let me know how it goes!
I added the "$@":
echo '#!/bin/bash
xvfb-run -- /usr/bin/wkhtmltopdf "$@"' > bin/wicked_pdf
chmod +x bin/wicked_pdf
Most helpful comment
I added the
"$@":