All I could find is this: https://stackoverflow.com/questions/4034491/javax-print-attribute-printrequestattributeset-options-ignored-by-printer%5D http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4876267
Tilman Am 08.05.2015 um 01:04 schrieb Gregor Kovač:
Hi! I'm using PDFBox 1.8.9 and using this method to print a PDF file: private static void printWithPDFBox(File pdfFile, int copies) { PDDocument document = null; try { document = PDDocument.load(pdfFile); PrintService printService = PrintServiceLookup.lookupDefaultPrintService(); PrinterJob printJob = PrinterJob.getPrinterJob(); printJob.setJobName(pdfFile.getName()); printJob.setPrintService(printService); printJob.setCopies(copies); HashPrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet(); printRequestAttributeSet.add(new Copies(copies)); printRequestAttributeSet.add(SheetCollate.COLLATED); printJob.setPageable(new PDPageable(document, printJob)); printJob.print(printRequestAttributeSet); } catch (Exception e) { e.printStackTrace(); } finally { if (document != null) { try { document.close(); } catch (IOException e) { e.printStackTrace(); } } } } I have a test file with one page and when I call this method with copies greater than 1 I only get one page printed out. Am I doing something wrong? Best regards, Kovi
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org