?
Solved

Assistance writing a Printer Filter

Posted on 2000-03-20
4
Medium Priority
?
282 Views
Last Modified: 2013-12-06
I need to redirect print jobs to tray3 on a HP LasertJet 5si printer.  There will be a specific print queue set up so that all jobs sent to this queue will be directed to tray 3 of the HP printer, currently they default to tray 2 which contains the company letterhead.  The printer filter needs to be written in either BASH or PERL however BASH is preferred by the UNIX ADMIN.
0
Comment
Question by:markhwin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 21

Accepted Solution

by:
tfewster earned 300 total points
ID: 2639741
If you're using Solaris or HP-UX, HP printers are well supported, just do
lp ...  -o tray3 -o ...

To do this "manually" send "\033&l${mediasrc}H\c" to the printer at the start of
the print job, where mediasrc is the code for the tray (tray3=> mediasrc=4 for a
lj5si printer). If you're using PostScript, pre-pend "3 setpapertray" to the
print job instead.

To incorporate this in a printer filter/model script, if the interface/model
in /var/spool/lp is a script, it can be copied & the copy edited to fix the
paper tray options OR pre-pend these Laserjet 'commands' to the print file.
 
The print queue is then created with e.g.
lpadmin -p printername .. -i your_interface_name

If you're not using lp/Solaris/HP-UX we need to know more about what your
setup is...

Hope this helps, Tim
0
 
LVL 21

Expert Comment

by:tfewster
ID: 2661526
Any feedback yet?
0
 

Author Comment

by:markhwin
ID: 2661759
Sorry for the delay, I ended up being out of the office and away from a PC a few days after I submitted my question.  This looks good, thank you for your help.
0
 
LVL 21

Expert Comment

by:tfewster
ID: 2663218
You're welcome - If you need any more, add another comment to this question & I'll dig a bit deeper.

Cheers, Tim
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question