IronPDF How-Tos Image from PDF How to Rasterize a PDF to Images Chaknith Bin Updated:July 28, 2025 Rasterizing a PDF file involves converting it into a pixel-based image format like JPEG or PNG. This process transforms each page of the PDF into a static image, where the content is represented by pixels. Rasterization offers several advantages, including the ability to display PDF content, generate thumbnails, perform image processing, and facilitate secure document sharing. With IronPDF, you can easily and programmatically convert PDFs to images. Whether you need to incorporate PDF rendering into your application, generate image previews, perform image-based operations, or enhance document security, IronPDF has you covered. Get started making PDFs with NuGet now: Install IronPDF with NuGet PM > Install-Package IronPdf Copy the code IronPdf.PdfDocument .FromFile("path/to/example/pdf.pdf") .RasterizeeToImageFiles("image_*.png"); Deploy to test on your live environment Start using IronPDF in your project today with a free trial Free 30 day Trial Get started with IronPDF Start using IronPDF in your project today with a free trial. First Step: Start for Free How to Rasterize a PDF to Images in C# Download the C# library for rasterizing PDF to images Load an existing PDF or create a PDF from a file, HTML, or URL Invoke the RasterizeToImageFiles method to export images from the PDF document Specify the DPI to improve clarity Specify custom output image dimensions according to your requirements Rasterize a PDF to Images Example The RasterizeToImageFiles method is utilized to export images from a PDF document. This method is available on the PdfDocument object, whether you are importing a PDF document file locally or rendering it from an HTML file to PDF conversion guide, HTML string to PDF conversion guide, or URL to PDF conversion guide. Please noteA file extension such as .png, .jpg, or .tif is required for the FileNamePattern parameter. TipsThe asterisk (*) character contained in the FileNamePattern will be substituted with the corresponding page numbers. :path=/static-assets/pdf/content-code-examples/how-to/rasterize-pdf-to-images-rasterize.cs using IronPdf; // Instantiate Renderer ChromePdfRenderer renderer = new ChromePdfRenderer(); // Render PDF from web URL PdfDocument pdf = renderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/Main_Page"); // Export images from PDF pdf.RasterizeToImageFiles("wikipage_*.png"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Output Folder If the form fields' values are intended to be visible in the output images, please flatten the PDF before converting it to an image or pass true to the Flatten parameter of the method. Forms will not be detectable after using the Flatten method. Learn how to fill and edit PDF forms programmatically in the following article: "How to Fill and Edit PDF Forms." Rasterize a PDF to Images Advanced Example Let's explore the additional parameters available for the RasterizeToImageFiles method. Specify Image Type Another parameter provided by the method allows you to specify the file types for the output images. We support BMP, JPEG, PNG, GIF, TIFF, and SVG formats. Each type has its corresponding method that can be directly invoked from the PdfDocument object. Here are the available methods: ToBitmap: Rasterizes (renders) the PDF into individual AnyBitmap objects, with one Bitmap for each page. ToJpegImages: Renders the PDF pages as JPEG files and saves them to disk. ToPngImages: Renders the PDF pages as PNG (Portable Network Graphic) files and saves them to disk. ToTiffImages: Renders the PDF pages as single-page TIFF files and saves them to disk. ToMultiPageTiffImage: Renders the PDF pages as a single multi-page TIFF file and saves it to disk. SaveAsSvg: Converts the PDF document to an SVG format and saves it to the specified file path. ToSvgString: Converts a specific page of the PDF document to an SVG format and returns it as a string. :path=/static-assets/pdf/content-code-examples/how-to/rasterize-pdf-to-images-image-type.cs Specify DPI When using the default DPI of 96, the output images may appear blurry. To improve clarity, it is important to specify a higher DPI value when rasterizing. :path=/static-assets/pdf/content-code-examples/how-to/rasterize-pdf-to-images-dpi.cs using IronPdf; // Instantiate Renderer ChromePdfRenderer renderer = new ChromePdfRenderer(); // Render PDF from web URL PdfDocument pdf = renderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/Main_Page"); // Export images from PDF with DPI 150 pdf.RasterizeToImageFiles("wikipage_*.png", DPI: 150); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Specify Pages Index It is also possible to specify which pages of the PDF document you want to rasterize into image(s). In the example below, images of PDF document pages 1-3 will be generated. :path=/static-assets/pdf/content-code-examples/how-to/rasterize-pdf-to-images-page-indexes.cs using IronPdf; using System.Linq; // Instantiate Renderer ChromePdfRenderer renderer = new ChromePdfRenderer(); // Render PDF from web URL PdfDocument pdf = renderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/Main_Page"); // Export images from PDF page 1_3 pdf.RasterizeToImageFiles("wikipage_*.png", Enumerable.Range(1, 3)); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Specify Image Dimensions When converting PDF documents to images, you have the flexibility to customize the height and width of the output images. The specified height and width values represent the maximum dimensions, while ensuring that the aspect ratio of the original document is preserved. For instance, in the case of a portrait PDF document, the specified height value will be exact, while the width value may be adjusted to maintain the correct aspect ratio. :path=/static-assets/pdf/content-code-examples/how-to/rasterize-pdf-to-images-image-dimensions.cs using IronPdf; // Instantiate Renderer ChromePdfRenderer renderer = new ChromePdfRenderer(); // Render PDF from web URL PdfDocument pdf = renderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/Main_Page"); // Export images from PDF pdf.RasterizeToImageFiles("wikipage_*.png", 500, 500); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Specifications for Output Images The dimensions for the output images are specified using the width by height format, denoted as width x height. Portrait Landscape Frequently Asked Questions What is the process of rasterizing a PDF? Rasterizing a PDF involves converting each page of the PDF document into a pixel-based image format, such as JPEG or PNG, using software tools like IronPDF. Why is rasterizing PDFs useful? Rasterizing PDFs is useful for displaying content as images, generating thumbnails, performing image processing, and enhancing document security by preventing text extraction. How can I convert a PDF to image formats using C#? You can use IronPDF's RasterizeToImageFiles method in C# to convert PDF documents into image formats like BMP, JPEG, PNG, GIF, TIFF, and SVG programmatically. What image file formats can PDFs be converted to? Using tools like IronPDF, PDFs can be rasterized into various image formats including BMP, JPEG, PNG, GIF, TIFF, and SVG. How do I adjust the DPI for clearer images when rasterizing PDFs? You can specify the desired DPI when using IronPDF to rasterize PDFs, which allows you to control the clarity and resolution of the output images. Can specific pages of a PDF be rasterized into images? Yes, IronPDF allows you to specify particular pages of a PDF document for rasterization into images by defining the page indices in the conversion method. How can I change the dimensions of output images from a PDF conversion? When converting PDFs to images using IronPDF, you can customize the output image dimensions by setting the maximum height and width while maintaining the aspect ratio. What is the method to ensure form fields are visible in converted images? To ensure form fields are visible in output images, you should flatten the PDF form using IronPDF before conversion or enable the flatten option in the method. How can I save a PDF as a multi-page TIFF file? With IronPDF, you can use the ToMultiPageTiffImage method to convert and save all pages of a PDF as a single multi-page TIFF file. Is it possible to convert a PDF to SVG format? Yes, IronPDF provides methods such as SaveAsSvg and ToSvgString to convert PDF documents into SVG format. Chaknith Bin Chat with engineering team now Software Engineer Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience. Ready to Get Started? Free NuGet Download Total downloads: 14,993,319 View Licenses