принтер имеет двустороннюю печать, но печатает 2х страничный документ на отдельных листах, какие еще атрибуты добавить/исправить?
public class PrintingTest { public static void main(String[] args) throws PrintException, IOException { DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PAGEABLE; PrintRequestAttributeSet prnAttr = new HashPrintRequestAttributeSet(); prnAttr.add(OrientationRequested.LANDSCAPE); prnAttr.add(Sides.TWO_SIDED_SHORT_EDGE); HashDocAttributeSet docAttr = new HashDocAttributeSet(); docAttr.add(OrientationRequested.LANDSCAPE); docAttr.add(Sides.TWO_SIDED_SHORT_EDGE); PrintService[] ps = PrintServiceLookup.lookupPrintServices(flavor, prnAttr); if (ps.length == 0) { throw new IllegalStateException("No Printer found"); } System.out.println("Available printers: " + Arrays.asList(ps)); PrintService myService = null; for (PrintService printService : ps) { if (printService.getName().equals("Kyocera FS-6530MFP KX")) { myService = printService; break; } } if (myService == null) { throw new IllegalStateException("Printer not found"); } try (FileInputStream fis = new FileInputStream("d:/temp/final.pdf")) { Doc pdfDoc = new SimpleDoc(fis, DocFlavor.INPUT_STREAM.AUTOSENSE, docAttr); DocPrintJob printJob = myService.createPrintJob(); printJob.print(pdfDoc, prnAttr); } } }