Solved

Assistance writing a Printer Filter

Posted on 2000-03-20
4
273 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
  • 3
4 Comments
 
LVL 20

Accepted Solution

by:
tfewster earned 100 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 20

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 20

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
llcommand 6 88
can't umount nfs share after server goes offline... 4 75
check unix curl command return value 7 86
Solaris 4.1.3 cloning and booting 13 72
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now