Rasterize a PDF to Images
IronPDF allows any PDF document to be exported to image files in convenient formats or Bitmap objects. Image dimensions and page number ranges may also be specified.
// Install IronPdf with Nuget: PM> Install-Package IronPdf using IronPdf; using System.Drawing; //Example rendering PDF documents to Images or Thumbnails var pdf = PdfDocument.FromFile("Example.pdf"); //Extract all pages to a folder as image files pdf.RasterizeToImageFiles(@"C:\image\folder\*.png"); //Dimensions and page ranges may be specified pdf.RasterizeToImageFiles(@"C:\image\folder\thumbnail_*.jpg", 100,80); //Extract all pages as System.Drawing.Bitmap objects Bitmap[] pageImages = pdf.ToBitmap();
' Install IronPdf with Nuget: PM> Install-Package IronPdf Imports IronPdf Imports System.Drawing 'Example rendering PDF documents to Images or Thumbnails Private pdf = PdfDocument.FromFile("Example.pdf") 'Extract all pages to a folder as image files pdf.RasterizeToImageFiles("C:\image\folder\*.png") 'Dimensions and page ranges may be specified pdf.RasterizeToImageFiles("C:\image\folder\thumbnail_*.jpg", 100,80) 'Extract all pages as System.Drawing.Bitmap objects Dim pageImages() As Bitmap = pdf.ToBitmap()
IronPDF allows any PDF document to be exported to image files in convenient formats or Bitmap objects. Image dimensions and page number ranges may also be specified.