Rasterize a PDF to Images

C# + VB.Net: Rasterize a PDF to Images Rasterize a PDF to Images
 //Rendering PDF documents to Images or Thumbnails
using IronPdf;
using System.Drawing;

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();
'Rendering PDF documents to Images or Thumbnails
Imports IronPdf
Imports System.Drawing



Dim 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.