Printer Local question - TOP POST
Brian K. White
brian at aljex.com
Sat Feb 23 13:14:49 PST 2008
Scott Walker wrote:
> Brian,
>
> I really appreciate you taking the time to give me such a complete
> description of the way you are accomplishing "transcient, processing
> controlled, passthru printing" (GREAT DESCRIPTION!).
>
> I guess my only question, is why did you guys do it that way when
> "printer local" should have handled it? Did you try "printer local" and
> it did not work correctly or has it been so long that you've been doing
> it your way that you don't really rememeber?
>
> Thanks again,
>
> Scott
>
>
> Brian said:
>
>
> We do that (transient, processing controlled, passthru printing) by
>
> printer type "hplaser"
> tf = "/tmp/print"{@fi{@rn{@id{rand(){".pcl"
> system "umask 0;>"{tf
> printer file tf
> formm fooa
> formm foob
> ...
> form foox
> printer reset
> system "passthru"<tf
> x = remove(tf)
> ...
> end
> @once :
> x = rand("-1")
> end
>
> or system "tput mc5 ;cat"<fn<";tput mc4"
>
> Where passthru is either the binary by Jim Asman available on
> ftp.anzio.com, or a script like this:
>
> #!/bin/bash
> # hard coded, assumes bash and assumes ansi-like terminal
> # but, fast & light and works (on ansi-ish terminals) when terminfo is
> incomplete
> echo -en "\033[5i"
> cat "$@"
> echo -en "\033[4i"
>
> or
>
> #!/bin/ksh
> print "\033[5i\c"
> cat "$@"
> print "\033[4i\c"
>
> or
>
> #!/bin/sh
> tput mc5
> cat "$@"
> tput mc4
>
>
> tput or the passthru binary are the more correct way since they don't
> care what kind of shell you are in and they consult the terminfo
> database to find the printer escape codes (mc4,mc5) for your terminal,
> similar to the way filepro consults termcap to find PN & PS, instead of
> just assuming all terminals are ansi terminals.
>
> But annoyingly, the most commonly used terminals (linux, scoansi) do not
>
> have these fields defined by default. This is because, technically the
> the real scoansi or linux terminal is the system console, and that
> doesn't support passthru printing, so it's correct that it's definition
> in termcap and terminfo doesn't include features the terminal doesn't
> provide.
> It's only terminal _emulators_ that provide the feature.
>
> But, it's easy to add the tags to the terminfo definitions.
>
> Log in as root, using the desired end user terminal type.
> IF it is an ansi-like terminal (xterm, linux, ansi, scoansi, vt*,
> cons25,...)
> # infocmp >${TERM}.ti
> # echo 'mc4=\E[4i, mc5=\E[5i,' >>${TERM}.ti
> # tic ${TERM}.ti
>
> Note, single-forward-quotes on the echo command.
> It's ok on any os any (bourne-like) shell in this case.
> On linux you may need to find some package to install to get infocmp
> and/or tic commands.
> On suse it's "ncurses-devel" and not installed by default.
> Freebsd/sco/sun/everyone-else? just has it.
>
> bkw
>
>
> Scott Walker wrote:
>
>> Scott says:
>>
>>
>> "printer local" is listed as a valid command in both the on line fp
>> manual and in Laura's Help Files version 2.0.00
>>
>> >From the fp manual:
>>
>>
>> PRINTER LOCAL
>>
>>
>> Sends output to terminal printer. (UNIX/XENIX only)
>>
>>
It's just a side effect of the fact that 99 & 44/100th's of our printing
goes through a printing app that offers print/fax/email/pdf/html etc..
That works by always printing to a temp file and handing the temp file
to the app. The app then allows the user to do as many things with the
file as they want, view it, email a copy, print 3 copies etc... without
re-running original the report, which might have taken 5 minutes and
killed the machine while doing it.
Most of the steps that look like extra work are not really in our case,
since we do most printing this way, most tables have a gosub for setting
up the temp file and other things for clearing the slate for a new print
job.
So it's really like:
gosub prtinit
form "foo"
gosub prtsend
Which in the simpler cases could be reduced to:
FormName="foo" ; gosub prtform
bkw
More information about the Filepro-list
mailing list