#!/bin/sh # \ exec wish "$0" ${1+"$@"} # # tclpdf # # this file simply copies input to a random file # throws up a 'save as' for the pdf file and.. # runs ghostscript to convert the file to pdf # and exits package require Tk wm withdraw . set psfile /tmp/file.[expr rand()] set fhandle [ open $psfile w ] while { ! [ eof stdin ] } { gets stdin st puts $fhandle $st } close $fhandle set fname [ tk_getSaveFile -title "Save PDF file as" -defaultextension .pdf ] if { $fname != "" } { exec gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$fname -c save pop -f $psfile } exec rm $psfile exit