Question

I know already pdfkit and wiked_pdf. pdfkit does not generate as I expect pdf from a remote web page.

Therefore I'd like to run wkhtmltopdf command in from within a ruby script as I do in the terminal.

In the script I've:

%x[wkhtmltopdf "http://www.radiozamaneh.com/67671" "./kaka.pdf"]

But the command is not executed. How should I do this?

Thanks in advance

Was it helpful?

Solution

It works the way you described:

%x[wkhtmltopdf "http://www.radiozamaneh.com/67671" "./kaka.pdf"] 
Loading page (1/2)
QFont::setPixelSize: Pixel size <= 0 (0)                     ] 38%
QFont::setPixelSize: Pixel size <= 0 (0)=============>       ] 88%
QFont::setPixelSize: Pixel size <= 0 (0)==============>      ] 89%
QFont::setPixelSize: Pixel size <= 0 (0)==============>      ] 89%
QFont::setPixelSize: Pixel size <= 0 (0)===============>     ] 90%
QFont::setPixelSize: Pixel size <= 0 (0)===============>     ] 90%
Printing pages (2/2)                                               
QFont::setPixelSize: Pixel size <= 0 (0)
Done                                                           
 => "" 

So, obvious questions:

  1. Do you have this program installed in your box?
  2. The user that is running rails have the binary on its $PATH variable?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top