Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

PDF printing of Webpage

by artist (Parson)
on Aug 09, 2007 at 20:38 UTC ( #631652=perlquestion: print w/replies, xml ) Need Help??

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).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://631652]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-12-09 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?