http://qs321.pair.com?node_id=631652

artist has asked for the wisdom of the Perl Monks concerning the following question:

I like to get a web page and convert into PDF automatically. I am trying to find a solution in which I don't have to launch an instance of Internet Explorer to print to the PDF File. htmldoc and perl interface doesn't meet the expectations. Also html2pdf doesn't cut it for the html files having extensive CSS and Javascript. I am looking for alternative solutions.
Thanks for the help.
--Artist

Replies are listed 'Best First'.
Re: PDF printing of Webpage
by Corion (Patriarch) on Aug 09, 2007 at 21:06 UTC

    You can automate OpenOffice and it has an "export as PDF" option. See the JODConverter (for Java) and PyODConverter (for Python) - you just need to port this to Perl.

    The setup and inner workings of PyODConverter are described on that page, and if you can't understand the Python code you can still use a network sniffer to find out how the UNO protocol works.

      OpenOffice to render HTML pages??

      If it even works (I've already voiced my concern in personal communications), it'll probably won't "meet the expectations" either.

        I guess any static medium won't meet the criteria of "extensive JavaScript", but then again, I'm only offering possible solutions that haven't been mentioned yet. I guess that OpenOffice, like its role model, MS Word, can read http:// URLs and also can read and render HTML files (and likely does a job just as botched as Word does).