It depends if you're using Windows XP or Windows 7/8. On Windows 7/8, you simply go to your Printers under control panel, add a new printer, choose local, and when it asks for a port, in the drop down list just choose "Print to File". When it asks what printer and driver, just choose something from Adobe or HP...any will really work. Then when you print to that printer it will ask you to save the document to a directory of your choosing. This is where the program that you write comes in to play. You would have your program search for the file, make a copy of it, then send the file to a real printer. The quickest way I know to do this would be via a shell command. See below:
- Shell("cmd /c *.prnFileLocation* /b *PrinterShareLocation*
Here's an example with
made up data.
- Shell("cmd /c c:\TestPage.prn /b \\printserver1\Printer1
The shell command I've provided is in Visual Basic because that's the language I know best. But you should be able to convert to C# pretty easily. Good luck!