#!/usr/bin/perl -w use strict; my $device="/dev/ttyS7"; # change this to your needs! print "ensure the Tektronix prints as \"EPS Color /Encapsulated Postscript color plot/\"\n"; print "connect it to $device (for me: Quatech interface D)\n"; open F, "<$device" or die "cannot open $device\n"; print "\npress the HARDCOPY button\n\n"; my $eps=""; my $i=0; while (){ s/.*translate 90 rotate$/20.00 20.00 translate/; $eps .= $_; print "\rEPS line " . $i++; last if /^%\%EOF$/; } close F or die "cannot close $device\n"; print "\n"; my $outname="TDSsnapshot"; $outname=$ARGV[0] if $ARGV[0]; print "creating $outname.eps\n"; open F, ">$outname.eps" or die "cannot open $outname.eps\n"; print F $eps; close F or die "cannot close $outname.eps\n"; print "creating $outname.png\n"; open F, "| /usr/bin/gs -sDEVICE=png256 -q -dSAFER -dNOPAUSE -dBATCH -g630x480 -sOutputFile=$outname.png -_" or die "cannot pipe into /usr/bin/gs (ghostscript not installed?)\n"; print F $eps; close F or die "cannot close $outname.eps\n"; print "done.\n";