简体   繁体   中英

How can I save a PrintDocument to a file?

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?

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";

Look a the following reference: Microsoft.Office.Tools.Word Namespace

Another link to msdn documentation How to: Save Documents

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM