Forum How do I...?

Change Paper tray (inputslot)

ThomasQvist
We are considering using PrinceXml to produce business letters. We do however need to use different paper trays on the printer (i.e. first page from tray 1 with the stationary, and next pages from tray 2).

Can you control the paper trays in PrinceXml
(I assume that the equivalent in PDF is InputSlot).

Best regards

Thomas Qvist
mikeday
We don't have any method to specify different paper trays at the moment, it is assumed that this will be handled when the PDF itself is printed. I didn't realise that it was actually possible to specify different paper trays for different pages within the PDF file itself. :)
Stephan Neumann (old)
This is also a request from my customers, it would save them a lot of time (and letterhead paper when they forget to change the tray after printing the first page). So if you would find a solution it would be much appreciated.

regards, Stephan Neumann

mikeday
Perhaps this is something that can be done with JavaScript embedded in the PDF file? It sounds fairly tricky, though.
StephanNeumann
It turns out to be possible by creating a separate printer(driver) for each tray and then call them from within the PDF with Prince/Adobe functionality:

@prince-pdf {
prince-pdf-script: "var pp = this.getPrintParams(); pp.firstPage = 0; pp.lastPage = 0; pp.printerName='Letterhead'; this.print(pp);pp.firstPage = 1; pp.lastPage = 99; pp.printerName ='Plain';this.print(pp);"
}


Of course the printernames must match the local computer printernames, which sort of blows the PDF concept.

Using the Adobe Javascript API specification (google for getPrintParams) you can expand this to automatic printing and much more.