Skip to main content

Printing some doc in a only one print job

No replies
Roydor
Offline
Joined: 2012-04-18
Points: 0

Hi, I'm new on this forum.
I have a problem. I muss print many doc in a single Print job.
I have a PDF with some pages and for exemple:

  • - the page 1 is :
    • orientation : Portrait
    • single side
    • MediaTray.Top
  • - the page 2 - 5 is :
    • orientation : Paysage
    • dupley_long_edge side
    • MediaTray.Top
  • - the page 6 is :
    • orientation : Portrait
    • dupley_long_edge side
    • MediaTray.middle

I have a code how print with the good format but for this exemple I have 3 printJobs on my printer Queue.

I use this code :
private void print(Imprimante nImprimante, DocumentOCAS nDoc, PDFPrint nPDFPrint){
PrinterJob travailImpression = null;

travailImpression = PrinterJob.getPrinterJob();
try {
travailImpression.setPrintService(nImprimante.getPrintService());
travailImpression.setPrintable(nPDFPrint);

//impression du document en fonction des attributs de chaque pages ranges
for (FormatImpression unFormat : nDoc.getListeFormat()) {
setDocAttributes(nImprimante, nDoc, unFormat);
travailImpression.print(attributes);
}
} catch (PrinterException e) {
e.printStackTrace();
}
}

I attache all my codes for this project.

If you want see more classes tell me.
If some body can help me, it will be great! Thanks

P.S: my english is not very good so if is not clear tell me :-)

AttachmentSize
org.zip131.52 KB