Printing from different trays

This question is about the usage of lpr and/or lp.

My printer has 3 trays: #1 is the manual feed, #2 contains paper for the first page of a letter and #3 contains blank paper for the rest of the document. Most letters should be printed using tray#2 for the first page and tray#3 for all subsequent pages of the same document.

It is easy to select a tray for the whole document. The command looks something like:

lpr -o media=A4 -o media=Upper -Plp document.ps

but for the desired effect I have to prepare the first page (normally with dvips), print that, then prepare the rest and print it separately. This is not very elegant, because the job of another user may be processed in between of the 2 steps. Is there a better way?

You don’t say what model of printer it is; it may be that it lacks the appropriate drivers in Linux.

It is a HP LaserJet P4514n. But I think this does not matter at all. The printer does exactly what the print command says. The problem is that there is no print option to take the paper for the first page from tray x and for subsequrnt pages from tray y.

The printer offers such functionality for the manual paper feed. When there is just one sheet of paper in the manual feed all subsequent pages will print from the default tray. However I want to solve this on the software side.

On 2010-06-23, vodoo <vodoo@no-mx.forums.opensuse.org> wrote:
>
> It is a HP LaserJet P4514n. But I think this does not matter at all. The
> printer does exactly what the print command says. The problem is that
> there is no print option to take the paper for the first page from tray
> x and for subsequrnt pages from tray y.
>
> The printer offers such functionality for the manual paper feed. When
> there is just one sheet of paper in the manual feed all subsequent pages
> will print from the default tray. However I want to solve this on the
> software side.

I don’t think you’ll find this as a printer option.
It’s more something you’d expect an aplication to do.

I know MS’s Word does this. Haven’t used OpenOffice’s Write enough to know
if it can.


Any time things appear to be going better, you have overlooked
something.

In the old days, this was a trivial problem; you just sent the PCL code from within the document!

One way to check whether the trays have been detected would be to download kpdf from kdegraphics-pdf and see if it acknowledges more than one tray. Okular still lacks some of kpdf’s facilities; so may not be able to do this.

Because I only have one tray, the HP Device Manager doesn’t have a tray option; but I don’t know whether that is because of my hardware or because it hasn’t yet been added as an option to HP Device Manager.

When I look in the OpenOffice printer properties, I don’t get as many options as I do with kpdf; so I wonder if some options have not been fully implemented in OpenOffice. But. as I only have the one tray, OpenOffice may simply decline to offer them.

I can see all available paper trays in kpdf (and even some more which the printer doesn’t actually support). However, I have to use either the ‘lpr’ or ‘lp’ commands to do the actual printing, because the print operation is invoked from a shell script. I can do the work-around and issue 2 separate print commands, one for the first page and another one for the rest of the document.

I was hoping that there is an elegant solution, because this is a very old problem. But as it seems the only solution would be to hack the source code of ‘lp’ and add the functionality :open_mouth:

lpr has an option option=value] which sets a job option; could that be used to send the PCL tray escape codes?

Unfortunately not: CUPS Software Users Manual

Another example of new technology being a downgrade rather than an upgrade. Looks like the only option is to use the printer default of putting the first page in the manual feed.