.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfDocumentProcessor.CreateBitmap(Int32, Int32) Method

Exports a PDF page to a bitmap image.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v21.1.dll


public Bitmap CreateBitmap(
    int pageNumber,
    int largestEdgeLength


Name Type Description
pageNumber Int32

An integer value, specifying the converted page’s number.

largestEdgeLength Int32

An integer value, specifying the length of the image’s largest dimension, in pixels.


Type Description

A Bitmap object.



Set the PdfDocumentProcessor.RenderingEngine property to Skia to enable this method on Azure Web Apps.

The CreateBitmap method has two parameters: the converted page’s number and the length of the image’s largest dimension in pixels. The latter parameter determines the output image height for pages in the portrait orientation and width - for landscape pages.

You can reduce the output image size and memory consumption if you pass a smaller largestEdgeLength value to the CreateBitmap method. The document page will not be clipped when it is converted to bitmap. The page will be proportionally scaled so that the largest edge of the converted bitmap is equal to the largestEdgeLength value.


The CreateBitmap method uses GDI/GDI+ rendering and works only on Windows OS. The PlatformNotSupportedException is thrown on other operating systems.


The following example illustrates how to convert pages to bitmap images.

View Example

using DevExpress.Pdf;
using System.Drawing;

namespace ExportToBitmap {
    class Program {

        static void Main(string[] args) {

            int largestEdgeLength = 1000;

            // Create a PDF Document Processor.
            using (PdfDocumentProcessor processor = new PdfDocumentProcessor()) {

                // Load a document. 

                for (int i = 1; i <= processor.Document.Pages.Count; i++) {

                    // Export pages to bitmaps.
                    Bitmap image = processor.CreateBitmap(i, largestEdgeLength);

                    // Save the bitmaps.
                    image.Save("..\\..\\MyBitmap" + i + ".bmp");
See Also