Hello, all!
My application implements complex logic print documents. Whats why I should add some logic into print dialog. How I can customise print dialog?
Or alternative solution - get list of installed printers?
Thank you advance
Solved.
I customised PrintPreviewDialog: add printer and pages to toolbar like this
printers = PrintServiceLookup.lookupPrintServices(null, null);
PrintService defaultPrinter = PrintServiceLookup.lookupDefaultPrintService();
String defaultName = “”;
if (defaultPrinter!=null){
defaultName = defaultPrinter.getName();
}
int i=0, selected=0;
for(PrintService printer:printers){
if (!"".equals(defaultName))
if (defaultName.equals(printer.getName()))
selected = i;
printerComboBox.addItem(printer.getName());
i++;
}
printerComboBox.setSelectedIndex(selected);
}
Hi Boris,
It is nice to hear from you that you have found the solution of your query. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.