tags:

views:

218

answers:

1

Hi,

I have to modify an existing printing solution (.NET 2.0, C#) that currently prints documents to a single printer so that it can print to multiple printers, with fail-over capability (if one printer is down, it uses a backup printer). I need to create a developer environment (and later a system test environment) that will emulate a multi-printer set-up. I cannot use a mocking framework, as the actual print jobs have to be created and sent to the printer as part of the testing. It would be useful if the resulting print jobs could be saved or recorded in some way i.e. print job 1 was received by printer 2.

Do you have any pointers on how to create this set-up? I am already looking into using Print To File options, but any other information would be appreciated. Many thanks in advance for your replies.

Regards, Andy.

+1  A: 

Hi,

An initial answer is to make use of a virtual print monitor, such as this one from AlphaTronics. Using the File to Print option, I can set up multiple virtual printers that point to different folders on the file system, i.e. Printer1 prints files to C:\temp\Folder1, Printer2 prints files to C:\temp\Folder2, etc. Using this set-up, I can then mock the LIVE environment and write tests, etc to determine that the correct printer has printed (i.e. a file was generated in the correct folder). Appending a .PRN extension to the generated files, I can also view the print file using a tool like PCL Reader.

Hope this helps someone else.

Regards, Andy.

MagicAndi