Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How can I generate a pdf from html/css?

by boblawblah (Scribe)
on Feb 17, 2009 at 01:25 UTC ( [id://744257]=note: print w/replies, xml ) Need Help??


in reply to How can I generate a pdf from html/css?

This is something I have been looking for as well. Unfortunately, there is no such utility (that I have found) to convert HTML to PDF with CSS support. Here are the utilities that I have come across that you may be interested in:

HTMLDoc - Provides a free version (which you must compile form source or find a binary on the internet, which the provide links to) and a commercial version. Provides basic HTML support (no CSS), with some limitations (for instance - try using tables within tables to layout your pages). There is a corresponding perl module to interact with HTMLDoc.

html2ps - Converts html to postscript - not sure if supports conversion to pdf as well.

A possible alternative is to use the Gtk2::MozEmbed to render the html and print to then print to PDF. I was not able to get Gtk2::MozEmbed to work on windows (if anybody has, please contact me).
  • Comment on Re: How can I generate a pdf from html/css?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2026-01-21 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (125 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.