Convert PDF to Image in C#

The simplest way to convert PDF to image as of 2024 is using PDFtoImage libary like below. This libary works for dotnet 8.0 as well. example: Read pdf file and save page 1 (index 0) to jpg file.
using PDFtoImage;
using var pdfStream = File.OpenRead(@"Sample.pdf");
Conversion.SaveJpeg("image-fileStream.jpg", pdfStream, 0, options: new(Dpi: 300, Width:1024, Height:null, WithAspectRatio:true));
You can file more detail in https://github.com/sungaila/PDFtoImage, which is MIT license.

Leave a comment

Please note that we won't show your email to others, or use it for sending unwanted emails. We will only use it to render your Gravatar image and to validate you as a real person.