How can I save a PrintDocument to a file?

Peter Bennett picture Peter Bennett · Jun 17, 2012 · Viewed 9.9k times · Source

I've created a PrintDocument in C#, I can print it, but now I want to save it to a file. Is it possible to save it as a word document?

Answer

RGroppa picture RGroppa · Oct 30, 2012

Depending on your intent, this might be useful:

If your goal is to reprint it at a later date this will work:

print_doc.PrinterSettings.PrintToFile = true;
print_doc.PrinterSettings.PrintFileName = "backup.prn";