After reading around it seemed to me that Prawn is out and wkhtmltopdf is in. It also seems like the PDFKit and wicked_pdf gems for Rails are the new co
The fix by scarver2 worked for me as advertised. But I needed a more recent version of wkhtmltopdf
. Since the homebrew version still seems outdated (it still hangs on the command line), and since there isn't a recent precompiled binary available, I used the os x build script to compile one myself:
$ git clone git@github.com:wkhtmltopdf/wkhtmltopdf.git
$ cd wkhtmltopdf
$ ./build_osx.sh # i'm running 10.9.2
$ bin/wkhtmltopdf --version
Name:
wkhtmltopdf 0.12.1-72a9f2066fe9ffd162dec007a4d9b6a5cd63b670
$ curl www.example.com | bin/wkhtmltopdf - test.pdf # render pdf of example.com
$ open test.pdf # to confirm pdf
I'm using pdfkit 0.6.2
with Rails 3.2.17
. I put the binary in /vendor
and, in a pdfkit
initializer, pointed to it with config.wkhtmltopdf
. So far, so good.