Anyone have any familiarity with RedHat printool and print filter
internals?
My postscript-ready Lexmark Optra 40 does not have an output tray that
stacks output properly so the pages stack from last to first, meaning
that I have to manually reverse the order.
Now I know that I can use the psselect utility from psutils package to
reverse the order of a Postscript file manually, but I was interested in
trying to do this automatically.
Interestingly enough, printtool has obsolete, commented out code that
allows the setting of a REVERSE_ORDER flag that resides in the
postscript.cfg file built by printtool, and stored in
/var/spool/lpd/{spooldir}. I fixed this, and now can set or clear a
REVERSE_ORDER flag for my printer. The comments referred to 'psorder'
as a way to resequence the pages, but I figured that psselect would work
equally well.
The next step was to figure out how this setting was used, and evidently
the input filter, 'filter', built by printtool, also stored in
/var/spool/lpd/{spooldir}, figures out what kind of file is being sent
to lpr, and builds a command made up of a concatenated set of filters to
handle it. These shell-script-based filters are the {foo}.fpi files
found in /usr/lib/rhs/rhs-printfilters, and _these_ build the final
ghostscript (or other) commands needed to process the input file and
route it to the printer device.
If you edit /var/spool/lpd/{spooldir}/filter, there are debug flags that
an be turned on that write to /tmp/filter.debug to see which {foo}.fpi
files were selected to process the file to be printed.
Since I have a Postscript capable printer, all files sent to lpr
eventually end up passing through ps-to-printer.fpi as their final
step. This filter also has comments about reverse page ordering, but no
code to do it. This filter reads the
/var/spool/lpd/{spooldir}/postscript.cfg file to determine various
settings, and I added the code needed to identify if REVERSE_ORDER was
set and tried to modify the final command needed to print the file to
include psselect to reorder the pages.
This is where I am stumped!! I can cat a postscript file through the
new ps-to-postscript.fpi filter directly and it will be reversed. I
included debug statements in the filter to echo the final print command
I assembled, and it looks good. From these debug statements I an tell
that when I send a file to 'lpr' the new filter is being used, but if I
lpr a postscript file, the darn thing ends up on the lpd queue in its
original order!!! Since the printer is a postscript printer, the actual
byte-stream stored on the queue is a postscript file, and I can use 'gv'
to look at it. I have also used 'less' on it, in case gv was smart
enough to hose around with the page order, since well-formed postscript
often includes comments that indicate page numbers and page sequence.
This is driving me nuts!! Any suggestions would be welcome.
I did not want to make this too long, but if anyone cares, I can send up
my new printool, and ps-to-printer.fpi files if anyone is interested.
Thanks,
--
Tom Porter [EMAIL PROTECTED]
--------------------------------------------------------------------
"On two occasions I have been asked [by members of Parliament],
'Pray, Mr. Babbage, if you put into the machine wrong figures, will
the right answers come out?' I am not able rightly to apprehend the
kind of confusion of ideas that could provoke such a question."
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list