Solved

Assistance writing a Printer Filter

Posted on 2000-03-20
4
272 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
Comment Utility
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
Comment Utility
Any feedback yet?
0
 

Author Comment

by:markhwin
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

762 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

12 Experts available now in Live!

Get 1:1 Help Now