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 to JPG Converter VB.NET Library
How to convert PDF file to JPG images using Visual Basic .NET?


Online VB.NET Tutorial for PDF to JPEG (JPG) Conversion in VB.NET Image Application





In this Visual Basic .NET tutorial, you learn how to convert PDF page to jpg image using VB.NET in .NET Windows Forms, WPF application.

How to convert PDF page to JPG image in VB.NET code?

  1. Download XDoc.PDF JPEG Converter VB.NET library
  2. Install VB library to convert PDF page to JPG image
  3. Step by Step Tutorial














Without using any other external software, our VB.NET PDF to JPEG converting component can help developers convert standard PDF file to high-quality JPEG image file independently. And converted JPEG image preserves all the content (including both images and texts) of original PDF document page.

Furthermore, if you are a Visual C# .NET programmer, you can go to this Visual C# tutorial for PDF to JPG conversion in ASP.NET.NET web application







PDF to JPG Image Options in VB.NET Code


You can easily convert a single PDF file or mutliple PDF documents into Jpg images. The following Jpeg image options supported in VB class "ImageOutputOption":


  1. Color: Output image is Monochrome, Gray, Color.

  2. JpegProgressive: If true, create Progressive JPEG image; If false, create Baseline JPEG.
    Baseline JPEG
    To encode image line by line from top to bottom. When opening a large baseline JPEG image through a very slow internet connection, the image would be renderred from top to bottom.

    Progressive JPEG: To encode image initially with full-size but low-quality pixellated. When opening a large baseline JPEG image through a very slow internet connection, the image would be renderred in full size looking pixelated at beginning, and then the quality becomes more and more clear.

  3. JpegQualityLevel: Quality level, 0, 20, 40, 60, 80, 100 (Highest Quality).

  4. Zoom: Set zoom value to 2F. Use more pixels to render the page.

  5. Resolution: Set image resolution value in the JPEG file.



Below are the steps and VB.NET sample source code to apply the converted JPEG image options programmatically using VB.NET.

  1. Create a new ImageOutputOption object
  2. Set image type as ImageType.JPEG
  3. Set JPG image as a color image
  4. Enable JpegProgressive to true
  5. Set JPG image quality level to 80
  6. Set PDF page zoom value to 2
  7. Set JPG image resolution to 300 dpi



        Dim options As ImageOutputOption = New ImageOutputOption()
        ' Set output image type.
        options.Type = ImageType.JPEG
        ' Output image Is grayscale.
        options.Color = ColorType.Gray
        ' Progressive
        options.JpegProgressive = True
        ' Quality level, 0, 20, 40, 60, 80, 100 (Highest Quality).
        options.JpegQualityLevel = 80
        ' Set zoom value to 2F. Use more pixels to render the page.
        options.Zoom = 2.0F
        ' Set resolution value in the JPEG file to 300 dpi.
        options.Resolution = 300






How to convert PDF page to JPG image using VB.NET


Converting PDF pages to JPG images using XDoc.PDF in VB.NET is straightforward. Use the PDFPage.ConvertToImage() method to convert the PDF page to JPG image directly. Below are the steps and VB.NET example source code.

  • Apply the converted JPEG image options in class ImageOutputOption
  • Create a new PDFDocument object and load an existing PDF file to it.
  • Get a PDFPage object from the first page of PDF document
  • Use PDFPage.ConvertToImage() method to convert PDF page to JPG file with image options applied



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

Dim options As ImageOutputOption = New ImageOutputOption()
' Set output image type.
options.Type = ImageType.JPEG
' Output image Is grayscale.
options.Color = ColorType.Gray
' Progressive
options.JpegProgressive = True
' Quality level, 0, 20, 40, 60, 80, 100 (Highest Quality).
options.JpegQualityLevel = 80
' Set zoom value to 2F. Use more pixels to render the page.
options.Zoom = 2.0F
' Set resolution value in the JPEG 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 JPEG image
page.ConvertToImage(options, outputFilePath)