Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Tray in PCL and print PDF afterwards in same job

Status
Not open for further replies.

patmatxd

Programmer
Aug 4, 2021
2
DE
Hello,
I wanna send PCL data to a printer before printing a pdf in raw form.
If i try to run the following code it will pick the right tray but the pdf wont be printed correct.

ESC%-12345X
@PJL ENTER LANGUAGE = PCL
[Setting the correct tray]
@PJL ENTER LANGUAGE = PDF
[Printing the PDF]
ESC%-12345X

I am aware that i cant change the language during the print job.
I dont know what else to do since the printer does not support a statement for choosing trays like "@PJL SET MEDIASOURCE = TRAY2".
 
Pat,

I'm surprised that if the printer accepts PJL commands at all, that it won't also accept tray commands. Those are pretty fundamental.

For most HP models:

<Esc>%-12345X@PJL JOB
@PJL SET MEDIASOURCE=TRAY2
@PJL ENTER LANGUAGE=PDF

Which brand and model of printer are you using? If not HP, perhaps it contains a proprietary method of selection, but that method should be discernible. For example, Kyocera uses @PJL SET KINTRAYSELECT=INTRAY2.

I believe Lexmark has their own variation as well.
 
First of all: Thanks for your reply. I almost forgot that i made this Thread
To clear things up:
I found out that the printer does NOT accept PJL commands. Canon support confirmed that. So there is no way for this particular printer to select the tray in PJL.
This means that you can only select the tray via PCL and you can not change the language back to PDF.
Printer: Canon i-sensys lbp325x

Edit: I thought at first that the Printer supports PJL because it understood PCL after i "changed" the language with the SET LANGUAGE COMMAND.
But it automatically chooses the Language of the first command it understands and sets the language for the whole printjob.
 
Pat,

I downloaded and took a look at the PPD (PostScript Printer Description) file for your Canon LPD 325x to see what the PostScript command was for selecting Tray 2.

While I realize that PDF is NOT PostScript, it is at least derived from PostScript. Thus, it might be worth a try to see whether sending the PostScript tray select command just prior to sending the PDF will accomplish what you seek.

I'll grant this may not work, but it costs nothing but a small amount of time, so here it is:


Code:
 %!PS-Adobe-2.0
currentpagedevice /InputAttributes get 2 get null ne
 {<</InputAttributes <</Priority [2]>> >>
 systemdict /setpagedevice get exec} if
 <</MediaType (ANY) /Policies <</MediaType 2>> >> systemdict /setpagedevice get exec

Send that bit of PostScript code, then immediately send your pdf. Note that the tray is specified by "Priority". The "MediaType" seems generic and is used the the selection routines for ALL the trays.

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top