Skip to main content

PDF creation

  • March 3, 2025
  • 1 reply
  • 2 views

Ken Schwartz

Has anyone used Microsoft Print to PDF to generate PDF's dynamically?  For example, our application produces a text file from which we want to create a PDF.  Using C#, the following could be used:

PrintDocument.PrinterSettings.PrinterName = "Microsoft Print to PDF";
PrintDocument.PrinterSettings.PrintToFile = true;
PrintDocument.PrinterSettings.PrintFileName = "pdf_filename";

However, I'm having difficulty generating a def file for the System.Drawing and System.Drawing.Common dll's.



------------------------------
Ken Schwartz
Senior Engineer, Development
Southware Innovations, Inc
Opelika US
------------------------------

1 reply

Stone Liao
  • Participating Frequently
  • March 11, 2025

Has anyone used Microsoft Print to PDF to generate PDF's dynamically?  For example, our application produces a text file from which we want to create a PDF.  Using C#, the following could be used:

PrintDocument.PrinterSettings.PrinterName = "Microsoft Print to PDF";
PrintDocument.PrinterSettings.PrintToFile = true;
PrintDocument.PrinterSettings.PrintFileName = "pdf_filename";

However, I'm having difficulty generating a def file for the System.Drawing and System.Drawing.Common dll's.



------------------------------
Ken Schwartz
Senior Engineer, Development
Southware Innovations, Inc
Opelika US
------------------------------

When you want to print something, just use win$printer to choose the printer for "Microsoft Print to PDF". Like the sample program do:



------------------------------
Stone Liao
Manager
Channelmaker Technology Co., Ltd.
Taipei TW
------------------------------