Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

How to convert html2pdf?

by gube (Parson)
on Jul 17, 2006 at 15:53 UTC ( #561776=perlquestion: print w/ replies, xml ) Need Help??
gube has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

I need to convert html to pdf. I use these below code to convert this html to pdf files. Here, for the sample site http://www.msn.com i save as the site page and give as argument 0 and mentioned the image path as argument 1. I am getting images with html text as pdf output file looks good. But, css is not working fine..i think means css flow is not seems exact in pdf as seems in site..Can anyone give me some ideas or refer opensource tool to do...

#!/usr/local/bin/perl use HTML::HTMLDoc; my $htmldoc = new HTML::HTMLDoc(); $htmldoc->set_input_file($ARGV[0]); $htmldoc->path($ARGV[1]); my $pdf = $htmldoc->generate_pdf(); $pdf->to_file($ARGV[2]); #!/usr/local/bin/perl use HTML::HTMLDoc; my $htmldoc = new HTML::HTMLDoc(); $htmldoc->set_input_file($ARGV[0]); $htmldoc->path($ARGV[1]); my $pdf = $htmldoc->generate_pdf(); $pdf->to_file($ARGV[2]);

Comment on How to convert html2pdf?
Download Code
Re: How to convert html2pdf?
by marto (Bishop) on Jul 17, 2006 at 15:59 UTC
Re: How to convert html2pdf?
by mikeock (Hermit) on Jul 17, 2006 at 20:00 UTC
    Don't try to convert non-standard Microsoft sites!
    My sig Sucks!
Reaped: Re: How to convert html2pdf?
by NodeReaper (Curate) on Jan 27, 2014 at 11:00 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-12-25 16:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls