The Syncfusion .NET PDF-to-image converter uses PDFium, the PDF rendering engine in Google Chrome, to convert PDF documents into images.
The converter supports customization in image conversions, such as setting a transparent background and removing annotations from a specific page or a range of pages.
The conversion feature works seamlessly on various platforms, including WinForms, WPF, Blazor, ASP.NET Core, and ASP.NET MVC.
The following code demonstrates the conversion of a PDF to images.
using Syncfusion.PdfToImageConverter;
// Initialize PDF to Image converter.
PdfToImageConverter pdfToImageConverter = new PdfToImageConverter();
// Load the PDF document as a stream.
FileStream pdfInputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite);
pdfToImageConverter.Load(pdfInputStream);
// Convert PDF to Image.
Stream[] imageOutputStreams = pdfToImageConverter.Convert(0, pdfToImageConverter.PageCount - 1, false, false);
// Save each image to a file.
for (int i = 0; i < imageOutputStreams.Length; i++)
{
// Create a file name for each image.
string outputFileName = $"sample-{i}.png";
// Convert the stream to a MemoryStream and save it as a PNG file.
File.WriteAllBytes(outputFileName, (imageOutputStreams[i] as MemoryStream).ToArray());
}
Explore different key features of PDF to image conversion.
Convert a selected page from a PDF into an image by indicating its index. This capability makes it simple to extract content from specific pages and use the resulting images in various applications.
Convert a range of PDF pages to images by specifying the pages. This makes it easy to extract and use content from multiple pages across different applications or platforms.
Create PDF thumbnails by converting specific pages into small preview images. This feature helps users quickly preview and identify PDF content, making document management more efficient.
Customize the converted image’s size, resolution, and other settings for perfect exports every time.
Discover valuable resources from our blog and knowledge base on converting PDFs to images.
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
PDF-to-image conversion is the process of transforming a Portable Document Format (PDF) file into an image file format, such as JPEG or PNG, where each page of the PDF is converted into a separate image.
Yes, you can convert specific pages to images using the Syncfusion PDF-to-image converter.
Yes, the Syncfusion PDF-to-image converter is designed to preserve the layout and formatting of complex documents to the greatest extent possible.
The most common image formats for PDF conversion are JPEG and PNG.
Yes, you can convert scanned PDF document pages to images using the Syncfusion PDF-to-image converter.
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.