form command and printer file "nameoffile"
Brian K. White
brian at aljex.com
Tue May 15 12:02:14 PDT 2012
On 5/15/2012 1:09 PM, Dennis Malen wrote:
> I also tried: printer file "nomjudg.txt"; form "affatty"
Do it like this:
et = "/tmp/filename.txt"
system noredraw "umask 0;>"{et
printer type "hplaser"
printer file et
form "formname"
printer reset
Except in real life I never use a hardcoded static filename like that so
that multiple users can't step on each other, and I don't leave temp
output files lying around after use, and I put most of that into gosubs
so it really looks more like this:
gosub prset
form "formname"
gosub pfe
prset:'print file setup
printer reset
declare printfile(256,,g)
printfile = getenv("PFTMP"){"/"{@fi{@rn{getenv("LOGNAME"){rand()
system noredraw "umask 0;>" { printfile
printer type "hplaser"
printer file printfile
return
pfe:' print/fax/email
printer reset
system "d" < printfile
x = remove(printfile)
return
"d" is just a (poorly named) thing of our own that takes a filename and
prints it, faxes it, emails it, puts it into a pdf, displays it in a
browser etc, either interactively with a menu or non interactively
controlled by environment variables. You wouldn't literally use that
line. It just serves to show what order to do things in. Where I have
system "d" < printfile you would have whatever you need to do with the
file.
--
bkw
More information about the Filepro-list
mailing list