#!/usr/bin/perl my $tmpfile = "demo.ps"; my $outfile = "demo.png"; open my $ps, ">", $tmpfile or die "Cannot create temp file '$tmpfile': $!"; print $ps <<'EOF'; %!PS % (include any non-standard fonts here...) /Times-Roman findfont 300 scalefont setfont 10 10 moveto % position (Perl) true charpath % charpath makes outline 5 setlinewidth 1 setlinejoin 1 setlinecap [.1 6] 0 setdash % dotted line 0 0 0.5 setrgbcolor % in dark blue stroke showpage EOF close $ps; system "gs -q -dBATCH -dNOPAUSE -sDEVICE=pngalpha -r140 -g1000x500 -sOutputFile=$outfile $tmpfile";