Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://573922]
and a soft breeze sighs...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2017-06-28 23:49 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (653 votes). Check out past polls.