Hi there,
I am trying to print a document with printer trays are setup in the docx. When I print the document it is always printed in the default tray. Attachment is my document
And below is how I print:
String printerName = "\\\\printerserver\\my_printer_name"; PrinterJob pj = PrinterJob.getPrinterJob(); PrintService[] service = PrinterJob.lookupPrintServices(); for (PrintService printService : service) { if (printService.getName().contains(printerName)) { pj.setPrintService(printService); break; } } PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet(); Document docout = new Document(dataDir + "test2.docx"); AsposeWordsPrintDocument awPrintDoc = new AsposeWordsPrintDocument(docout); pj.setPageable(awPrintDoc); pj.print(attributes);
document.zip (8.9 KB)