I am in the process of converting a VB6 program that creates two page form letters for several thousand individuals each week. These letters are legally mandated, not junk mail. The letters are printed as one document to a postscript printer driver so that they can be both sent directly to a printer and converted to a PDF for archival purposes.
I am having difficulty determining how I can go about this using c#. All of the examples I have seen for printing from c# use the PrintPageEventHandler to handle the printing, but I don't see a way to use this without having created all of the form letters before even starting the print routine. Am I missing something?
The code I am converting works like this:
Loop through all groups that have letters Loop through all members in each group who need letters Send page one of the letter to the printer Send page two of the letter to the printer
When the routine is finished there is one postscript file that has five thousand or so pages in it. That file is then sent to the printer and also converted to a PDF for archival.
Is there a non-event way of printing to a printer in c#? This is a console application if that is important.