I wanted to create PDF files for my rails application using wkhtml2pdf and wicked_pdf.
I downloaded and extracted wkhtml2pdf beta 4 and placed it in / usr / local / bin / wkhtml 2pdf
I tried to run it on a website and it gave a good result.
In my rails application (2.3.4), I set wicked_pdf:
script / plugin install git: //github.com/mileszs/wicked_pdf.git
script / generate wicked_pdf
Everything seemed to be in order. inside script / console I run the following - (with the following output)
wp = WickedPdf.new
=> # WickedPdf: 0xb62f2c70 @exe_path = "/ usr / local / bin / wkhtmltopdf"
HTML_DOCUMENT = "<html><body>Hello World</body></html>"
=> " <html><body>Hello World</body></html>"
pdf = wp.pdf_from_string HTML_DOCUMENT
=> "/ usr / local / bin / wkhtmltopdf - - -q"
=> "\ n \ n \ n \ n \ n \ n \ n \ n \ n \ n"
Of course, this is not good. According to the test, the result of my last command should start with "% pdf-1.4"
Any idea what I can do?
source share