(Thanks) network/Postscript Printer problem

Polytropon freebsd at edvax.de
Mon Sep 14 11:30:39 UTC 2015


On Sun, 13 Sep 2015 21:33:54 -0600 (MDT), Warren Block wrote:
> On Sun, 13 Sep 2015, reg at dwf.com wrote:
> 
> >
> > Thanks to all that responded, I finally got rid of
> > a couple of nasty typos, and the printer is working.
> >
> > I should be able now to put together a couple of
> > input filters to do single/double sided printing.
> 
> This thread in the forums is a couple of years old, but shows some 
> examples of creating a duplex-printing filter:
> https://forums.freebsd.org/threads/lpd-print-filters.40651/

To enrich the mailing list with some examples, I'd like to share
my own "printer filter" for duplex functionality. :-)

I have defined two printers, "Laserjet" and "Laserjer-nodup"
in /etc/printcap, created their spool directories and made
them almost identical, except for the printer filters, which
themselves are almost identical, as you'll see:



This is the duplex filter: /opt/libexec/ps2pcl-dup.sh 

#!/bin/sh
/usr/bin/printf "\033&k2G" || exit 2
/usr/local/bin/gs -q -dBATCH -dNOPAUSE -dPARANOIDSAFER -dSAFER \
        -sDEVICE=ljet4d -sPAPERSIZE=a4 -r600x600 \
        -dDuplex=true \
        -sOutputFile=- - && exit 0
exit 2



And this is the simplex filter: /opt/libexec/ps2pcl-nodup.sh

#!/bin/sh
/usr/bin/printf "\033&k2G" || exit 2
/usr/local/bin/gs -q -dBATCH -dNOPAUSE -dPARANOIDSAFER -dSAFER \
        -sDEVICE=ljet4d -sPAPERSIZE=a4 -r600x600 \
        -sOutputFile=- - && exit 0
exit 2



However, those filters translate the input PS to output PCL.
I did this because the printer in question (HP Laserjet 4000 DN)
will print PCL faster than PS. That's the only reason. You need
to install the Ghostscript port (gs) for this task.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list