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

Re: Paper Reports with PDF or...?

by rbi (Monk)
on Apr 16, 2003 at 09:13 UTC ( [id://250817]=note: print w/replies, xml ) Need Help??


in reply to Paper Reports with PDF or...?

In order to create PDFs I've installed html2ps, written in Perl, and Ghostscript that has the ps2pdf utility.
And then I do something like this in my CGI appplications:
my $HTML2PS = '/usr/local/bin/html2ps -L'; my $PS2PDF = '/usr/bin/ps2pdf'; # First create an HTML file that I want to print 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;
It's under Linux, but will probably work under other OSs. Hope this helps.

Ciao, Roberto

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-28 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found