Search code examples
c#windows-servicesprintdocument

PrintDocument (c#) ignores printer configuration


I've got a few logical printers configured and pointing to the same physical printer. Each logical printer is configured with a specific input and output tray. Opening a document, e.g. a pdf, and printing to any one of these printers results in a correct input/ouput print. However i've developed a windows service (win2003) and when i use the PrintDocument class to print, the printer ignores the configuration of the target logical printer and just prints using (it would appear) default settings (e.g. any input tray => top output tray). I've tried the same service on an XP machine and it all works fine.

Any ideas?

Thanks Sean


Solution

  • Ok seems the problem is the printer configuration settings are user specific. So once i logged in as the user that the service is running under, configured the printer - all worked fine.