C# code tutorial

PDF to Image PDF Creating & Inserting PDF Digital Signature PDF Extracting PDF Processing & Editing PDF Protecting PDF Chart PDF Barcode

Popular .NET SDK

Convert PDF to Bmp image, each PDF page will be saved as one independent BMP file.

The Microsoft Windows bitmap (BMP) format is a widely known raster image file format. It is regarded as the parent format of some other raster images like JPG, PNG, and GIF, BMP, but it is rarely to see BMP images used on the web. This file format is specially used to store bitmap digital images independently of a display device, originally and primarily on Microsoft Windows and OS/2 operating systems. Converting PDF to BMP is also a common usage in various fields. If your C# .NET application requires such conversion functionality, XsPDF .NET PDF to Image SDK can help you to save you a lot of programming time.

Load your PDF documents and convert them into BMP images with ease using XsPDF .NET PDF to Image library. As a standalone .NET assembly developers can just reference it in your .NET application and start C# coding right away. This online tutorial will discuss how to use .NET PDF to Bitmap Converting Library. More specifically, it will cover how to do PDF to bmp image conversion in C# class project.

// Create a PDF converter instance by loading a local file 
PdfImageConverter pdfConverter = new PdfImageConverter("sample.pdf");

// Set the dpi, the output image will be rendered in such resolution
pdfConverter.DPI = 96;

// the output image will be rendered to grayscale image or not
pdfConverter.GrayscaleOutput = false;

for (int i = 0; i < pdfConverter.PageCount; i++)
    // Convert each pdf page to bmp image with original page size
    //Image pageImage = pdfConverter.PageToImage(i);
    // Convert pdf to bitmap in customized image size
    Image pageImage = pdfConverter.PageToImage(i, 500, 800);

    // Save converted image to bmp format
    pageImage.Save("Page " + i + ".bmp", ImageFormat.Bmp);

More Excel tutorial