Easy way to determine the print code table type in a processing tables?
Brian K. White
bw.aljex at gmail.com
Thu Mar 26 10:00:10 PDT 2020
If you already have the means to adjust the contents injected into the
form, or select a different form, on the fly, then a quick&dirty is just
insert a question in their .profile that asks what kind of printer they
have, and then detect THAT in processing.
The next better version of that is use the terminal emulator to set the
variable (and have .profile export it) rather than an interactive prompt
in .profile. That is a more annoying one-time setup per user, figuring
out how to edit the config in their terminal emulator, but the advantage
is they don't have to answer a question at every login. It just happens
by itself. If they are using ssh, you will have to add that variable to
the list of accepted variables in /etc/ssh/sshd_config
But really the existing process sounds a bit too locked in to matrix if
there is processing putting escape codes into the output bypassing the
print code table.
That blows out the entire purpose of print code tables, which are there
to make exactly what you need today possible.
I would have thought that you wouldn't be able to get around that except
by one of a few different non-trivial options:
* replace every instance of processing inserting a print code, with a
gosub or call table that looks up the print code from a table the way fp
itself does.
* print to temp file and post-process the file with a sed or awk or
other script to convert all the matrix codes to something else.
Neither of these is happening fast unless you only have a few forms and
only a few print codes to recognize and translate.
At first blush I would just say "you're boned".
A long time ago I figured out a way to get some of the binaries from
vsi-fax's free demo to run without the rest of the vsi-fax install, and
without the limits they intended to impose on the demo (you could copy
the tar to other machines and the programs ran forever), and one of the
binaries was essentially a matrix-to-tiff renderer, with a fixed output
resolution that was only 200dpi. I had exactly the idea to print old
matrix forms right to a browser or pdf, but really that's a bit too
janky to do for real. But, it's *possible*. I couldn't find any other
epson/ibm matrix renderer at the time.
Instead we just phased out all the matrix forms and made everything
laser, and convert from pcl to tiff or pdf for fax or on-line viewing.
For converting a form, the first and easiest issue is just the page
length. If you don't already have both matrix and laser versions of
forms, then the most basic change to convert a matrix form to laser is
just set the line height to a slightly shorter height such that you end
up with 66 lines on a page. A matrix printer prints all the way from top
to bottom, for a total of 66 lines. A laser has unprintable space at
both top and bottom, for a total of 60 lines. But PCL allows you to do
exotic things, so you can insert this print code in the F8 Options
printer-init or in the top-left corner of the form etc, to squish the
line height down to fit 66 lines, and maybe you can get away without
having to do anything else to the form for some forms.
3 ◆ $1b & l 0 O $1b ( 10 U ◆ Initialize printer
66 ◆ $1b&l66p2e7.27c66F ◆ * 66 lines per page
--
bkw
On 3/26/20 11:45 AM, Michael Schwartz (PC Support & Services) via
Filepro-list wrote:
> Environment: Filepro 5.8.03.30D6 running on Linux
> 3.10.0-693.17.1.el7.x86_64
>
>
>
> Is there any "getenv" variable I can grab from inside a processing
> table to tell which printer I am on, or what PFPRTC (pf printer codes table)
> is active when a report is run? For example, if a laser printer named
> laser23 is active and define printers shows a print code table of hp-4050
> assigned to it, a MSGBOX line like:
>
>
>
> THEN: msgbox "PFPRTC=" {getenv("PFPRTC")
>
>
>
> Displays:
>
>
>
> PFPRTC= (blank)
>
>
>
> I've tried testing for getenv("PFPRINTER"), but PFPRINTER is blank,
> too.
>
>
>
> THE FULL PROBLEM (in case you have a better idea for solving the issue.):
>
>
>
> I'm trying to make changes to some filePro forms that currently print
> correctly *ONLY* on a dot-matrix printer so that they will print correctly
> on *EITHER* a dot-matrix *OR* a laser printer.
>
>
>
> I'm trying to avoid creating duplicate forms, one for a laser printer
> and one for a dot-matrix printer.
>
>
>
> There are a lot of forms that get called from inside invoice
> processing and in cron batch scripts, so I'm trying to avoid setting my own
> environmental variables, like setting YOURPRINT=DOT; export YOURPRINT or
> YOURPRINT=LASER; export YOURPRINT.
>
>
>
> The reason these forms will only print correctly on a dot-matrix
> printer is that, in addition to the print codes on the forms, they have
> strings of embedded print codes in the processing tables, like this:
>
>
>
> IF: 'Epson Esc/Elongated On/Off
>
> THEN: es=chr("27")';bl=es&"E";nb=es&"F"
>
>
>
> Strings BL and NB are embedded in the invoice lines and then a "print"
> command is issued.
>
>
>
> Looking at the hp-4050 laser printer table (remembering Jim Asman) I
> see that ESC-E causes the laser printer to do a "Printer Reset". The
> printer reset causes the forms to print one line on each page, so if an
> invoice form has 10 detail lines on it, 10 pages spit out of the laser
> printer with one line printed on each page.
>
>
>
> Of course there is some urgency in this because of the Corona virus.
> Sales people working from their homes would like to print invoices and other
> forms using their home laser printers. I couldn't talk the company into
> buying dot-matrix printers for each of their employees to use at home.
> <grin>
>
>
>
> Thanks!
>
>
>
> Mike Schwartz
>
>
>
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20200326/5e24ec67/attachment.html>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list