when printing with Java, one can select the media tray (within PrintRequestAttributeSet). Then one can pass this setting to a printjob and have one's document printed to the given tray.
My question is now: can I somehow specify that the first page is printed to one tray and the second one to another tray within one print job?
I'm reluctant to creating two separate print jobs, because my usage scenario is a mass-print, of say 1000 documents. Each document has some pages going to tray 1 and some pages going to tray 2. If I have to create a new print job on each switch of trays, I would end up with several thousands of separate print jobs and I'm afraid of all sorts of print-spooler overruns and system crashes. Thus my preference to somehow sneak those "switches of tray" into one print job.
I'm pretty sure that it can be sone somehow, but didn't succeed so far.
I thought about creating those thousands of PrinterJobs, but having them print to a StreamPrintService (instead of an actual print service), thus capturing the switches of tray along with the actual printing data. Then I was planning to concatenate the results of those single "virtual" prints and send it all to a real printer in one real print job.
However, with java 1.6 there seems to be only one StreamPrintService, which can only output postscript. So: is there a way to capture the raw, native output from a native printer driver (using java)? Does it seem practical to you to concatenate that output and send it to the printer, in order to solve my problem?
I would be glad, also about comments regarding only parts of the problem..