tags:

views:

1446

answers:

5

I've been using htmldoc for a while, but I've run into some fairly serious limitations. I need the end solution to work on a Linux box. I'll be calling this library/utility/application from a Perl app, so any Perl interfaces would be a bonus.

A: 

I wont claim this is the "best" solution but it is "a" solution i have used.

HTML Input --> HTML 2 PS --> PS 2 PDF --> PDF Output

Declan Shanaghy
+1  A: 

This would be total overkill, but you could download and install mirth. It is a message routing engine, but it has the ability to convert html to pdf, so you could set it up to pick up an html file in a folder, convert to pdf, and drop the pdf in the same or other folder. Like I said, overkill, a bit of a learning curve, but it's free, and java so you can run it on linux if you like. And all your perl app would have to do is drop the html to a file.

Jeremy
+4  A: 

I did a bit of googling for you and came up with two options. There may be more, my google strategy was to try "webkit command-line pdf" and "gecko command-line pdf", basically looking for commandline programs that embed the two popular open-source rendering engines in command-line renderers. Here's what I found:

Firefox command-line printer - outputs to pdf and png

wkpdf - while this is for mac, it's probably pretty portable.

bmdhacks
+4  A: 

PrinceXML is the best one I've seen (it parses regular HTML as well as XML/XHTML). How is it the best? Well, it passes the acid2 test which I thought was pretty darn impressive

It is however, quite expensive

Orion Edwards
I've had this same problem. I've recently evaluated Prince XML and can vouch for it being a SERIOUSLY awesome app. The speed and quality of the output is simply unbelievable.
cletus
+2  A: 

Sorry to unearth this old post, but it came out first in my search for the best HTML/PDF conversion tool. On Linux wkhtmltopdf is very good (takes into account CSS, among others) and GPL.

Alexandre