If you want to convert html to a pdf, there's no easier way to do it other than wkhtmltopdf!
I found some other interesting tid bits too:
- wkhtmltopdf 0.8.3 was released July 21st 2009, use that or a later version
- Drupal has a module which uses it: Printer, e-mail and PDF versions
- ohloh.net has indexed it
- Debian has a package
- Found an article about the compiling and X server aspects by Ciaran McNulty
Make sure you use the 0.8.3 or greater version, otherwise you may get an error:
"wkhtmltopdf: cannot connect to X server"
If you are using this from a web server, you need to use the proper headers for a PDf file. Even though that example is in PHP, the same applies to Perl as well (using some form of CGI (I use CGI::Fast))
print header(
-Content_type => 'application/pdf',
-Content_disposition => 'attachment; filename=report.pdf',
);
-Content_type => 'application/pdf',
-Content_disposition => 'attachment; filename=report.pdf',
);
Note: Put in whatever name you like in place of "report.pdf"
Perhaps in the near future I'll have a nice examples site with all the code!
Excellent site. Plenty of helpful info here.
ReplyDeleteI'm sending it to some friends ans additionally sharing in delicious.
And of course, thanks on your sweat!