0

I need to know if the default printer is going to print to a file, and if it is, to find a reliable way to send the filename to the printer driver to avoid it popping up the file dialog. Anyone know of a way to do this?

5
  • 1
    When you say default printer, do you mean the system default printer, or the user's selected printer? And what about the poor user that would like to print to a file? Why do you want to ride roughshod over them? Surely they chose to print to a file for good reason? Dec 8, 2014 at 9:34
  • As far as I know printer service has no information or controll wheter certain print job would be sent to actual printer or saved into the file. That is the job of a printer driver wheter it is printer driver for actual printer or virtual printer driver which are most commonly used when printin into a file. And when you are printin tino file the file selection dialog that it shown is compleetly dependant on virtual rinter driver and not printing service. Dec 8, 2014 at 18:50
  • Now as far as I know there are virtual printer drivers which alow printing into file directly from your application and alow your aplication to specify the filename as parameter. But most of these rely on COM interface for comunication with your application. Se when you initiate print job for these system printing sxervice doesen't even know about that becopuse the print job is sent directly to the printer driver using this special COM interface. Dec 8, 2014 at 18:53
  • Anywhay if you want to "print" some data from your aplication into file instead on printer you might wanna take a look at some of the reporting components as most of them alow exporting that data into files similary as if you would sent print job to virtual printer which then prints that into a file. Dec 8, 2014 at 18:56
  • You can programmatically print to file and set the filename so the user isn't prompted (I have code for that), but I don't know of any way to detect whether the default printer is set to a file.
    – Ken White
    Dec 9, 2014 at 17:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.