Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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 taking refuge in the Monastery: (6)
As of 2015-11-27 08:26 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (722 votes), past polls