Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Free HTML to PDF utility

by howdy (Initiate)
on Jun 13, 2003 at 19:52 UTC ( [id://265781]=perlquestion: print w/replies, xml ) Need Help??

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

I am trying to convert my HTML webpages, that are running on a Windows IIS server, to PDF format for printing purposes. I have looked into HTMLDoc, which would work for what I want, but I was wondering if there are any recommended free utilities.

Thanks

Replies are listed 'Best First'.
•Re: Free HTML to PDF utility
by merlyn (Sage) on Jun 13, 2003 at 19:58 UTC

      I had to solve this same problem in the past. I tried using Perl Magick to solve it, but the results were horrible. The problem is that Image Magick converts the text to a graphic format and then the graphic to the pdf. The result is that you get a very large pdf with low resolution. :(

Re: Free HTML to PDF utility
by perrin (Chancellor) on Jun 13, 2003 at 20:08 UTC
    Print to a file. That gives you postscript. Then convert it with ps2pdf from the ghostscript distribution, which you can run on cygwin.

    No, it isn't very simple to set up. If you want simple, pay Adobe or try Open Office.

      I miss-worded my question, I was hoping to do the conversion on the fly with some sort of a function to print to the browser.

      Thanks
Re: Free HTML to PDF utility
by aplonis (Pilgrim) on Jun 14, 2003 at 06:31 UTC
    Google around for two scripts, html2ps and ps2pdf which you might like to try. I have used the second. But instead of the first I usually just print-to-file in Mozilla, with the output as *.ps. Then I run ps2pdf on on that. I do it on NetBSD Unix. But I suppose there had ought be Windoze versions... They are free, at least.
Re: Free HTML to PDF utility
by freddo411 (Chaplain) on Jun 14, 2003 at 00:22 UTC
    I would recommend products from the company PDFlib.com. While the cost is not cheap, they have fantastic support, are very knowledgable about using their lib with Perl, and will support dynamic server-side creation of PDFs from a template PDF.

    There are PDF modules on CPAN, but none that work as easily as the above.

    Disclaimer: I'm not affiliated with pdflib.com.

    Good Luck.

    -------------------------------------
    Nothing is too wonderful to be true
    -- Michael Faraday

Re: Free HTML to PDF utility
by Popcorn Dave (Abbot) on Jun 13, 2003 at 19:58 UTC
    Yes there is. Sort of...

    Check out this link at Adobe. It does what you want, and you can use LWP::Simple to write some simple code to save your HTML file to disc. Alternatively you can have them e-mail you the file.

    However I haven't tried it with a file with loads of graphics, so it may or may not do that for you.

    Hope that helps!

    There is no emoticon for what I'm feeling now.

    Update: Sorry, misread the question. Didn't notice you wanted to go HTML to PDF.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found