The Syncfusion .NET PDF to image converter library uses PDFium to convert PDF documents into images. PDFium is used in Google Chrome for rendering PDF files. It provides accurate and robust PDF rendering.
It supports customization in image conversion, such as setting a transparent background and removing annotations from a specific page or a range of pages.
The PDF-to-image feature works seamlessly on different platforms: WinForms, WPF, Blazor, ASP.NET Core, and ASP.NET MVC.
Here is an example of how to convert a PDF document to an image in C# using the Syncfusion PDF to image converter library. You can convert PDF documents to images with just a few lines of code.
//Initialize the PDF to Image converter
PdfToImageConverter imageConverter = new PdfToImageConverter();
//Load the PDF document as a stream
FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
imageConverter.Load(inputStream);
//Convert PDF to Image
Stream[] outputStream = imageConverter.Convert(0, imageConverter.PageCount - 1, false, false);
for (int i = 0; i < outputStream.Length; i++) {
File.WriteAllBytes("sample-" + i + ".png", (outputStream[i] as MemoryStream).ToArray());
}
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.