my $HTML2PS = '/usr/local/bin/html2ps -L';
my $PS2PDF = '/usr/bin/ps2pdf';
# First create an HTML file that I want to print
my $h2p = "
";
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;