How to Start Convert PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

PDF Converter VB.NET Library
How to convert PDF to Bitmap, png, jpeg raster Images in VB.NET


Supports Conversion of PDF Document to PNG, BMP, GIF and Bitmap Images in VB.NET Class





In this VB.NET tutorial, you will learn how to convert PDF to raster images, such as png, jpeg, bitmap, gif in Visual Basic code.

  • Convert PDF to images with basic image settings
  • Convert PDF to PNG with png image settings
  • Convert PDF to JPEG2000 with JPEG2000 image settings
  • Easy to enable PDF to image conversion in VB.NET WinForms, WPF Windows application

How to convert PDF to image files using VB.NET

  1. Download XDoc.PDF image conversion VB.NET library
  2. Install VB library to convert Adobe PDF to png, jpeg2000 files
  3. Step by Step Tutorial












Sometimes, to convert PDF document into BMP, GIF, JPEG and PNG raster images in Visual Basic .NET applications, you may need a third party tool and have some questions on API and sample codes.

Using our VB.NET PDF to Raster Images Conversion Control, you will not worry about the Whether the API, sample codes are provided for PDF document to raster images conversion, because we offer a detailed guide for this product. Our website offers PDF to Raster Images Conversion Control for VB.NET developers. Using this mature and advanced control, developers are able to load target PDF document from local file or stream and convert it into BMP, GIF, JPEG and PNG raster images through VB.NET programming. In addition, our PDF document conversion library also enables developers to render and convert PDF document to TIFF and vector image SVG. In the PDF document rendering process, developers can set PDF rendering options in VB.NET project.

On the guide page, you can not only get APIs and VB.NET sample codes for converting Microsoft PDF document to PNG, BMP, GIF and bitmap, but also gain specific knowledge of the four raster images.







PDF to Image Formats with Conversion Options


With XDoc.PDF for .NET, you can easily convert Adobe PDF document pages to any of the following raster image formats in your VB.NET application

  • ImageType.BMP
  • ImageType.GIF
  • ImageType.PNG
  • ImageType.JPEG
  • ImageType.JPEG2000
  • ImageType.TIFF


VB.NET Class ImageOutputOption allows you to apply image option settings during converting PDF pages to raster images in VB code.



Bitmap (BMP), Gif, JPEG2000 image options using VB.NET


You can easily convert single PDF file or mutliple PDF documents into PNG images. The following png image settings supported in class "ImageOutputOption":


  1. Color: Output png image is Monochrome, Gray, Color.
  2. Zoom: Set zoom value to 2F. Use more pixels to render the page.
  3. Resolution: Set image resolution value in the JPEG file.


PNG image options using VB.NET

Please view PNG image option details at How to convert PDF pages to PNG images in VB.NET.



JPEG image options in VB.NET

Please go to How to convert PDF pages to JPEG images in VB.NET for JPEG image options.



TIFF image options in VB.NET

Please go to How to convert PDF file to multipage TIFF image in VB.NET for TIFF image options.





VB.NET convert single pdf file to GIF image with image settings


This is a VB.NET programming sample code to convert PDF file to GIF image.

  1. Create a new ImageOutputOption object for converted GIF images
  2. Set image type to GIF ImageType.GIF
  3. Set GIF image color, zoom, and resolution values.
  4. Create a PDFDocument object with an existing PDF file loaded
  5. Get the first page object PDFPage of the PDF document
  6. Use the method PDFPage.ConvertToImage() to convert the first page of PDF file to gif image with options applied



Dim inputFilePath As String = "C:\1.pdf"
Dim outputFilePath As String = "C:\output.gif"

Dim options As ImageOutputOption = New ImageOutputOption()
' Set output image type.
options.Type = ImageType.GIF
' Output image Is grayscale.
options.Color = ColorType.Gray
' Set zoom value to 2F. Use more pixels to render the page.
options.Zoom = 2.0F
' Set resolution value in the PNG file to 300 dpi.
options.Resolution = 300

' Open file And get the target page
Dim doc As PDFDocument = New PDFDocument(inputFilePath)
Dim page As PDFPage = doc.GetPage(0)
' Convert page to a GIF image
page.ConvertToImage(options, outputFilePath)






VB.NET: How to convert the first PDF page to image file to preview


The steps and VB.NET source code below will show how to convert the first PDF page to preview in VB.NET application.

  1. Create a new ImageOutputOption object for converted PNG image
  2. Set image type to Bitmap ImageType.PNG
  3. Set image color to ColorType.Color
  4. Set PDF page zoom is 0.25F. The preview image area size is 25% of the original PDF page. You can choose to other values, if you need.
  5. Set PNG image resolution to 600 dpi. You can choose larger resolution for printing.
  6. Create a PDFDocument object with PDF file loaded
  7. Get the first page object PDFPage of the PDF document
  8. Use the method PDFPage.ConvertToImage() to convert the first page of PDF file to png image file



Dim inputFilePath As String = "C:\1.pdf"
Dim outputFilePath As String = "C:\output.png"

Dim options As ImageOutputOption = New ImageOutputOption()
' Set output image type.
options.Type = ImageType.PNG
' Output image Is color.
options.Color = ColorType.Color
' Set interlaced flag to false.
options.PngInterlance = False
' Set filter type to Average
options.PngFilter = FilterPNG.Average

' Set zoom value to 0.25F
options.Zoom = 0.25F
' Set resolution value in the PNG file to 600 dpi.
options.Resolution = 600

' Open file And get the target page
Dim doc As PDFDocument = New PDFDocument(inputFilePath)
Dim page As PDFPage = doc.GetPage(0)
' Convert page to a PNG image
page.ConvertToImage(options, outputFilePath)