Home > OS >  UWP C# Convert png to a pdf
UWP C# Convert png to a pdf

Time:10-29

Not sure if there is an easy thing out there for this. Is there a way so convert a png to a pdf file in a UWP program? I've got a program that reads in a lot of images and I'd like to edit them, then output as a pdf. I just need to convert a 1280 x 720 png file into a landscape pdf in the same location with the same file name so hopefully this could be done without the user needing to input too much.

I'm not really sure where to start on this.

Any pointers to anything relevant would be appreciated.

CodePudding user response:

First google result: enter image description here

We usually do not propose solutions (there are multiple ways). Rather we help you along the way - you should try something yourself, and when you get stuck then show what you tried.

CodePudding user response:

You can use the nuget package PdfSharp, it's the best library for C# enter image description here

using command

rundll32 "C:\WINDOWS\system32\shimgvw.dll" ImageView_PrintTo "c:\mydata\pixel.png" "My Print to PDF"

I cheated by having "My Print to PDF" duplicate "Microsoft Print to PDF"

  • Related