Now, let's get started to convert PDF document to BMP images in your C# application! Please keep in mind that steps below are only for your reference. You may decide whether to use all the PDF to BMP converting functions illustrated according to your C# project requirement. Do contact us (email@example.com) if you have any questions. pqScan is always ready to help.
- Launch Visual Studio (2005+) and create a new console project using C# programming language;
- Download pqScan .NET PDF to Image SDK Trial and add the DLL to project reference;
- Copy and paste free C# sample code below to your project;
PDF to BMP Image Conversion - C# Sample
The following free C# sample code shows how to convert PDF to BMP image in Visual Studio .NET project. You may also get more details for .NET PDF to BMP converting properties and APIs here.
static void Main(string args)
// Create an instance of PQScan.PDFToImage.PDFDocument object.
PDFDocument pdfDoc = new PDFDocument();
// Load a PDF document.
// Get the total page count.
int count = pdfDoc.PageCount;
for (int i = 0; i < count; i++)
// Rasterize PDF page to image.
Bitmap bitmap = pdfDoc.ToImage(i);
// Save image to bmp file type.
bitmap.Save("output" + i + ".bmp", ImageFormat.Bmp);
In addition, here's a C# coding sample for how to load a PDF from stream and transform it to the right size BMP image file. That is to say, you are empowered to customize the size of output BMP image according to your specific PDF document converting requirement.
static void Main(string args)
// Make a new instance of PQScan.PDFToImage.PDFDocument object.
PDFDocument pdf = new PDFDocument();
// Create a file stream with PDF information.
FileStream stream = new FileStream("sample.pdf", FileMode.Open);
// Load PDF document from file stream.
// Set output bmp image width.
int width = pdf.GetPageWidth(0) / 2;
// Set output bmp image height.
int height = pdf.GetPageHeight(0) / 2;
// Convert the first page of PDF to image with the desired size.
Bitmap bmp = pdf.ToImage(0, width, height);
// Save image to bmp image file format.
If you want to resize BMP image and change its quality through DPI, you may refer to this online C# tutorial: How to customize (BMP) image converted from PDF page using C#.
.NET PDF to Image Software
.NET PDF to Image Converting
.NET Converter: PDF to TIFF
.NET Converter: PDF to BMP
C# Converter: PDF to TIFF
C# Converter: PDF to PNG
VB.NET Converter: PDF to Multi-page TIFF
ASP.NET Converter: PDF to JPG
ASP.NET Converter: PDF to TIFF
ASP.NET Converter: PDF to PNG
View All Image Types >>
I ordered .NET PDF to Image SDK from pqScan.com and it was confirmed immediately. The SDK is all that I expected. After comparison with others in the market, I would like to say the price couldn't have been better. Thank you, pqScan!
SUPPORT SYSTEM: MICROSOFT WINDOWS XP, WINDOWS VISTA, WINDOWS 7, WINDOWS 8, WINDOWS SERVER. SUPPORT PLATFORM: .NET FRAMEWORK, VISUAL BASIC, VISUAL C#, ASP.NET, JAVA, JDK, SWING, APPLET, JSP, SERVLET, J2SE, J2EE. SUPPORT BARCODE TYPE: QR CODE, DATA MATRIX, PDF417, AZTEC CODE, CODE 128, CODE 39, CODE 93, CODABAR, EAN 13, EAN 8, UPCA, UPCE, ITF14. SUPPORT IMAGE FORMAT: JPEG, JPG, PNG, GIF, TIFF, TIF, BITMAP, BMP. SUPPORT VIEWER: MOZILLA FIREFOX, INTERNET EXPLORER, GOOGLE CHROME, OPERA, SAFARI, ADOBE and ACROBAT PDF.
Copyright © pqScan 2010-2019. All Rights Reserved.