Quantcast
Channel: Active questions tagged qpainter - Stack Overflow
Viewing all articles
Browse latest Browse all 49

Cannot write to temp files using wkhtmltopdf in Rails

$
0
0

I'm using Terrapin to execute wkhtmltopdf from command line inside Rails.

Terrapin::CommandLine.path = "/usr/bin/wkhtmltopdf"pdfCommand = Terrapin::CommandLine.new("xvfb-run wkhtmltopdf :html_source :pdf_target")tempHTML = Tempfile.new(["pattern", ".html"])tempHTML << htmltempPDF = Tempfile.new(["pattern",".pdf"])pdfCommand.run(html_source: tempHTML.path, pdf_target: tempPDF.path)

It runs, but returns:

QPainter::begin(): Returned falseError: Unable to write to destinationExit with code 1, due to unknown error.

I've made sure wkhtmltopdf has full permissions, I'm not sure if maybe Terrapin has something to do with this?

Edit: running xvfb-run wkhtmltopdf http://www.example.com test.pdf in console works as expected.


Viewing all articles
Browse latest Browse all 49

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>