Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Html to PDF convertor

by rbi (Monk)
on Sep 20, 2006 at 15:59 UTC ( #573922=note: print w/ replies, xml ) Need Help??

in reply to Html to PDF convertor

I've installed html2ps, written in Perl, and Ghostscript that has the ps2pdf utility.
then you could do something like:
my $HTML2PS = '/usr/local/bin/html2ps -L'; my $PS2PDF = '/usr/bin/ps2pdf'; my $plot_file_base = 'whatever'; # First create an HTML file (or slurp it from file) my $h2p = "<html><head></head><body> <img src=$pngfile> </body></html>"; my $file_to_ps = $plot_file_base.'_to_ps.htm'; open (FH,">$file_to_ps") or die "cannot open $file_to_ps: $!\n"; print FH $h2p; close(FH); # Then create a ps file my $file_ps = $plot_file_base.'.ps'; system "$HTML2PS $file_to_ps > $file_ps"; #And finally convert it to PDF my $file_pdf = $plot_file_base.'.pdf'; system "$PS2PDF $file_ps $file_pdf"; unlink $file_to_ps; unlink $file_ps;
Hope this can help.
Comment on Re: Html to PDF convertor
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2016-04-29 21:58 GMT
Find Nodes?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW

    Results (441 votes). Check out past polls.