Operating System - HP-UX
1823085 Members
3412 Online
109646 Solutions
New Discussion юеВ

Re: Printing to a specific tray?

 
AIMC
Frequent Advisor

Printing to a specific tray?

Hi,

For all you printing experts!

A colleague has a customer running HPUX who want to use tray 2 (this is the headed paper tray) on their printer every time the line "1BE" is at the top of a page to be printed. The default tray is tray 4. This is probably straight forward but my printing experience is zero!

Regards,

Aidan
5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: Printing to a specific tray?

lp -obin#


Pete

Pete
Gavin Clarke
Trusted Contributor

Re: Printing to a specific tray?

This script is my attempt to pick up the 1BE part of your question. There are probably better ways to do this.

It is run with two arguments: lp1BE -dprinter filename


TOPLINE=`head -1 $2`
if [ "$TOPLINE" = "1BE" ]
then
lp -obin2 $1 $2
else
lp $1 $2
fi

Cheers
AIMC
Frequent Advisor

Re: Printing to a specific tray?

Hi,

Thanks Pete & Gavin,

The lp -d -obin# seems to work for some files but not others, there are some PCL commands? attached to the top of files to be printed so i think they may have to look at this before anything else.

Aidan
Gavin Clarke
Trusted Contributor

Re: Printing to a specific tray?

Could you attach an example of one that doesn't work please?
Just so people can look and suggest options.

I'm thinking perhaps sed might be able to do something here.
Procnus
Frequent Advisor

Re: Printing to a specific tray?

This is just off the top of my head, and I haven't tested it:

cat | \
sed s/1BE/^]&l5G\
1BE/ | lp -d

The replace is with an Escape&l5G (Ctrl-V Esc & ell 5 G)

I hope this helps and I haven't confused you.

Cheers
Steven