Created attachment 23537 [details] the PrintRenderer The attached PrintRenderer uses the Java Print Service API, introduced in Java 1.4. It allows to programmatically set print options, like the destination printer and media tray. I use it like this: // Construct a FopFactory FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent userAgent = fopFactory.newFOUserAgent(); // Setup FOP print renderer PrintRenderer renderer = new PrintRenderer(); renderer.setUserAgent(userAgent); userAgent.setRendererOverride(renderer); // Construct fop with desired output format Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, userAgent); ContentHandler handler = fop.getDefaultHandler(); // lookup a printer PrintService service = PrintServiceLookup.lookupDefaultPrintService(); DocPrintJob job = service.createPrintJob(); PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet(); // set print request attributes here, like the media tray // print job.print(renderer, attributes); If this PrintRenderer replaced the current one (hint, hint), I could skip the "Setup FOP print renderer" section.
resetting P2 open bugs to P3 pending further review
increase priority for bugs with a patch