Copy link to clipboard
Copied
So you know how when you go to Mailings in MS Word and you go to print an envelope. When you print that envelope the printer knows to pull from the bypass tray based on the envelope.
This cannot be accomplished in code, however, is there a way to set the properties, by page, to print from the correct tray?
What I am trying to accomplish is to print the first page normally (8 1/2 x 11) and the second page (a manilla envelope in the bypass tray)
Is this possible?
Yes, it's possible. Use this code to tell the printer to select the paper tray based on the page size:
var pp = this.getPrintParams();
fv = pp.constants.flagValues;
pp.flags = pp.flags | fv.setPageSize;
this.print(pp);
Copy link to clipboard
Copied
Yes, it's possible. Use this code to tell the printer to select the paper tray based on the page size:
var pp = this.getPrintParams();
fv = pp.constants.flagValues;
pp.flags = pp.flags | fv.setPageSize;
this.print(pp);
Copy link to clipboard
Copied
I'm not sure how to modify this and I am not having any luck.
Is there a way to just make the first page print from tray 1 and the second out of tray 2?
Copy link to clipboard
Copied
Using a script? Only if each tray is defined as its own printer.
Copy link to clipboard
Copied
I'm not sure how I would accomplish that. I will have to dig into the printer settings and see if there is an option. Can you give me a completed example of the code above so I can figure out how to change it to match what we are using?
Copy link to clipboard
Copied
The code above is complete. It will send each page to the tray that matches its paper size.
Copy link to clipboard
Copied
Well that would be why my changes were not working. Do I set this as part of the file itself or attach it to the print button?
Copy link to clipboard
Copied
As a part of a button.
Copy link to clipboard
Copied
So I finally got the printer vendor to get the printer to pull from Tray 2 for the evidence envelopes as A4.
So utilizing your script, how do I tell page 1 to print 8 1/2 x 11 and Page 2 as A4.
This is what I currently have attached to the print button (I will be removing the app alert but I wanted to show you what was there currently.)
if (app.alert("Would you like to print an evidence envelope?",2,2)==4) {
app.alert("THE FIRST PRINT BOX THAT COMES UP IS FOR YOUR EVIDENCE SHEET. IN THE PRINTER PROPERTIES WHERE IT SAYS TRAY SELECTION, THIS SHOULD BE SET TO AUTOMATIC. CLICK PRINT AND YOUR EVIDENCE SHEET WILL PRINT FIRST. THE SECOND PRINT BOX THAT COMES UP IS FOR YOUR EVIDENCE LABEL. GO TO THE PRINTER PROPERTIES AND CHANGE THE TRAY TO BYPASS. MAKE SURE THERE ARE EVIDENCE ENVELOPES IN THE BYPASS TRAY. YOU MUST TUCK THE FLAP INTO THE INSIDE OF THE ENVELOPE AND PLACE THE ENVELOPE FACE DOWN WITH THE TOP OF THE ENVELOPE (THE FLAP) FACING AWAY FROM THE PRINTER.: ...",3);
this.print({nStart: 0, nEnd: 0}); // print page 1
this.print({nStart: 1, nEnd: 1}); // print page 2
} else {
this.print({nStart: 0, nEnd: 0}); // print page 1
}