It seems that the OpenPrinter(ps) doesn’t really use the printer/page setup selection that is in ps (loaded from previous saved parameters) and prints to the default printer, while OpenPrinterDialog(ps) works as expected but it opens a dialog. Is there a way to work around this, because I need to send reports to different printers, pre-selected for each report, without the user needing to choose which printer each time.
When I try it, and choose one printer with the first button, and another printer with the other button, then after that both buttons will print to the last chosen printer, and not to different printers as I had assigned them. I’m testing this on OS X 10.9.
Does this really work for someone here?
(update)
I’ve figured out how to choose the printer on OS X now, though:
By using the function CorePrinting.SetDefaultPrinter() from the MacOSLib, I can preselect the Printer I want to print to.
It worked for me, even though I think I had to press each button twice for it to work correctly. I think it has to do with the page setup preceding the printer selection…
I am actually developing on Mac, but this was needed for a Windows App. However, I first tested it on OS-X so I think it works on the Mac side as well.