Example Code

Convert PNG to PDF (Microsoft Print to PDF)

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

    Programming Language

  • .NET

Code and Documents

Attachment

Download All

Description

Good Day Folks!

Using .NET to convert a PNG file to PDF using Windows built-in "Microsoft Print to PDF" printer.

mceclip0.png

mceclip1.png

 

How to Use

input PNG file and get PDF out (letter, landscape)

Related Links

PrintDocument and Graphics classes...

https://learn.microsoft.com/en-us/dotnet/api/system.drawing.printing.printdocument

https://learn.microsoft.com/en-us/dotnet/api/system.drawing.graphics

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors