Solved Adding landscape, #10 envelope and papertray to LPR printfilter

After having success in OpenBSD I attempted envelope printing in FreeBSD based on Thread 48433 and this post in Daemon Forums. I initially changed my print filter from that recommended in wblock@'s web page (gs based filter) by migrating my working configuration from OpenBSD to another computer that was running FreeBSD 10.1/i386.
The printing output for example /usr/local/share/ghostscript/9.06/examples/golfer.eps was pages of text output from the eps file. I concluded that my filter was not functioning and spent hours trying to get foomatic-rip --ppd output to work. I gave up and went back to wblock@'s gs filter.

I'm wondering if another tact would be to pass a custom page size (#10 envelopes are 297pt x 684pt) and landscape orientation via gs? I could then set up a second queue referencing an envelope filter and /etc/printcap entry. Icing on the cake would be to also specify the manual feed print tray on my ancient, but sturdy, HP 5L Laserjet.

gs(1) describes a -PAPERSIZE option but env10/COM10 are not predefined sizes. I also seen mention of landscape orientation but
Code:
gs -h
and gs(1) does not give a lot of details. I have been able to generate *.pdf of my envelopes which print nicely from print/xpdf

Edit: grammer
 
Last edited:
I have done some more research regarding using foomatic-rip to access ppd drivers. foomatic-rip is available in either print/hpijs or print/foomatic-filters. The foomatic-filters binary has dependencies on print/a2ps and print/enscript-a4. It is possible to build foomatic-filters/enscript using letter.

What I'm confused about is:
1) It is possible to set papersize/custom sizes in both a2ps and enscript. Why the different ports for enscript-a4 and enscript-letter?
2) My ports searches also found print/papersize-default-letter. My understanding is that papersize is a system configuration set in /etc/papersize, /usr/local/etc/papersize. What does this port do that I would not do by editing papersize?

Edit: corrected gutenprint-filters to foomatic-filters
 
Last edited:
Success with:
/usr/local/libexec/ps2pcl:
Code:
#!/bin/sh
/usr/local/bin/gs -dSAFER -dNOPAUSE -q -dBATCH -r600x600 \
 -sDEVICE=ljet4 -sOutputFile=- -

/usr/local/libexec/ps2pcl_env10:
Code:
#!/bin/sh
/usr/local/bin/gs -dSAFER -dNOPAUSE -q -dDEVICEWIDTHPOINTS=297 \
 -dDEVICEHEIGHTPOINTS=684 -dMediaPosition=2 -dBATCH \
 -r600x600 -sDEVICE=ljet4 -sOutputFile=- -

/etc/printcap
Code:
# Default lp printer
lp|hp5l|ljet4:\
  :lp=9100@PS-8B4C0D:\
  :if=/usr/local/libexec/ps2pcl:\
  :sd=/var/spool/lpd/lp:\
  :lf=/var/log/lpd-errs:\
  :mx#0:\
  :sh:
# Envelope #10 printer
env10:\
  :lp=9100@PS-8B4C0D:\
  :if=/usr/local/libexec/ps2pcl_env10:\
  :sd=/var/spool/lpd/env10:\
  :lf=/var/log/lpd_env10-errs:\
  :mx#0:\
  :sh:

Comments: The needed documentation is either online or in /usr/local/share/ghostscript/9.06/doc. Apparently setting a width < height implies landscape printing and the specific option does not need to be added. On my ancient HP 5L laserjet the manual tray feed also does not need to be specified. 72 "POINTS"/inch.

Edit: Specified manual paper tray " -dMediaPosition=2" for env10 filter
 
Last edited:
Back
Top