javax.print.attribute.standard
PrintService printService = PrintServiceLookup.lookupDefaultPrintService();
PrintServiceAttributeSet attributes = printService.getAttributes();PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
attributes.add(Sides.ONE_SIDED);
PrintService printService = PrintServiceLookup.lookupDefaultPrintService();
DocPrintJob job = printService.createPrintJob();
job.print(new SimpleDoc(printContent, DocFlavor.INPUT_STREAM, DocFlavor.BYTE_ARRAY.getRepresentationClass()), attributes);PrintJob job = printService.createPrintJob();
JobAttributes attributes = job.getAttributes();DocFlavor flavor = DocFlavor.INPUT_STREAM.PNG;
Doc doc = new SimpleDoc(printContent, flavor, null);
DocAttributeSet attributes = new HashDocAttributeSet();
attributes.add(MediaSizeName.ISO_A4);DocFlavor flavor = DocFlavor.INPUT_STREAM.PNG;
Doc doc = new SimpleDoc(printContent, flavor, null);
DocAttributeSet attributes = doc.getAttributes();