PDF to Image for .NET
The ExpertPdf PDF to Image Converter exports the pages of a PDF document to images in any type of .NET
application. The result is a .NET Image object for each page, which you can use further or
save to disk in any image format .NET supports.
Choose the pages, the resolution and the color space, create thumbnails, and convert pages of password protected documents. No installation is needed to run the converter.
Everything PDF to Image does.
Convert the pages of a PDF document to images, with control over the pages, the resolution, the color space and the image format.
How pages become images.
From a file or a stream, the pages you choose, at the resolution and in the color space you set, from password protected documents too.
Convert a file or a stream
Pass the path of a PDF file, or a Stream holding the PDF document.
Choose the pages
Convert only a range of pages with StartPageNumber and EndPageNumber. By default all the pages are converted.
Set the resolution
Set the resolution of the images in DPI with the Resolution property. The default is 120 DPI.
RGB or grayscale
Choose the color space of the images with the ColorSpace property: RGB, the default, or grayscale.
Password protected PDFs
Convert the pages of password protected documents with the UserPassword property.
Thumbnails
ConvertToThumbnails creates thumbnails that fit a maximum width and height and keep the aspect ratio.
Where the images go.
In memory as .NET Image objects, or saved in a folder in the image format you choose.
.NET Image objects
ConvertToImages returns an array of System.Drawing.Image objects, one per page, to process further in your application.
Save to a folder
ConvertToImagesInFolder saves one image per page in the folder given by ImagesPath, with file names that start with ImagesPrefix.
Any .NET image format
The format of the saved images is a .NET ImageFormat, such as PNG or JPEG, set with the ImagesFormat property.
Get the page count
GetPageCount returns the number of pages of a PDF file or stream.
Multipage TIFF
ConvertToTiff returns the pages as one multipage TIFF, and ConvertToTiffInFolder saves it, with LZW, CCITT 3/4 (black and white), RLE or no compression.
One page at a time
ConvertPageToImage and ConvertPageToImageBytes convert a single page to an Image or to bytes in the format you choose.
JPEG quality and PNG compression
Set the JPEG quality from 0 to 100 with JpegQuality, and the lossless PNG compression level from 0 to 9 with PngCompressionLevel.
A PDF, as a folder of images.
The PdfToImageConverter class: save pages as image files, or get them in memory and return one from an ASP.NET Core controller. All the properties and methods are in the API reference.
using System.Drawing.Imaging; using ExpertPdf; var converter = new PdfToImageConverter(); converter.ImagesFormat = ImageFormat.Png; converter.ColorSpace = PdfToImageColorSpace.RGB; converter.Resolution = 150; // DPI converter.StartPageNumber = 1; converter.EndPageNumber = 3; converter.ImagesPath = "output"; converter.ImagesPrefix = "report"; // One image per page, saved in the ImagesPath folder converter.ConvertToImagesInFolder("report.pdf");
The download includes ready-to-use samples with their full C# and VB.NET source code.
Install from NuGet with dotnet add package ExpertPdf.PdfToImage, or read the developer's guide.
PDF to image questions, answered.
Common questions about output, image formats, resolution and page selection.
What does the converter produce?
ConvertToImages returns the pages as an array of .NET Image objects, one per page, that you can process further or save in any image format .NET supports. ConvertToImagesInFolder saves the images in the folder given by ImagesPath instead.Which image formats can I save?
ImagesFormat property to a .NET System.Drawing.Imaging.ImageFormat, for example ImageFormat.Png or ImageFormat.Jpeg. The file names start with the ImagesPrefix text.How do I set the resolution of the images?
Resolution property, in DPI. The default is 120 DPI. A lower resolution gives smaller images, for example thumbnails of the pages.Can I convert only some pages?
StartPageNumber and EndPageNumber properties. By default all the pages are converted. GetPageCount returns the number of pages of a document.Which color spaces are available?
ColorSpace property to PdfToImageColorSpace.RGB or PdfToImageColorSpace.Gray.Does it work with password protected PDF documents?
UserPassword property to the password that opens the document.Can it make thumbnails or a multipage TIFF?
ConvertToThumbnails makes thumbnails that fit a maximum width and height and keep the aspect ratio, and ConvertToTiff makes one multipage TIFF from the pages, with LZW, CCITT 3/4, RLE or no compression.Does it need an installation?
ExpertPdf.PdfToImage package from NuGet, or copy eppdftoimage.dll and eptools.dep from the download to the bin folder of your application and reference eppdftoimage.dll.Which .NET versions and operating systems are supported?
ExpertPdf.PdfToImage.x64, is also available for applications that run as x64 processes.Is there a free version I can try?
Convert PDF pages to images in .NET.
Download the free evaluation with C# and VB.NET samples. When you are ready, license it on the pricing page.