How to Convert a PDF to an Image in VB.NET

Written by ray padgett
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Convert a PDF to an Image in VB.NET
You need a special plugin to read and convert PDF files in VB.NET. (Jupiterimages/ Images)

VB.NET does not work with PDF files out of the box. However, because of demand, the Visual Basic company offers a PDF plugin. This allows you to not only read PDF files in VB.NET, but convert them to an image format (TIFF) you can use elsewhere. To do so, you first need to install the PDF plugin and then run some VB NET code.

Skill level:

Other People Are Reading


  1. 1

    Download the PDF plugin from the VB.NET website (link in Resources) by clicking the link marked "download the mjwPDF class and the PDF fonts." Click "Run" when the window pops up asking you what to do.

  2. 2

    Open VB.NET and select "Add" from the "Project" menu.

  3. 3

    Browse to the file you just downloaded. Click "mjwPDF.cls" and hit "Open." VB.NET is now PDF-compatible.

  4. 4

    Copy and paste the following code into VB.NET (but do not hit the "Enter" key yet):

    Dim no Append As TiffEncoder = New TiffEncoder(TiffCompression.Default, True)

    Dim pdf As PdfDecoder = New PdfDecoder(FILEPDF)

    Dim i As Integer=0

    Do While i< numPages

    Dim img As AtalaImage = pdfDecoder.Read(in Stream,i,Nothing)
    noAppend.Save(out Stream, img, Nothing)
    outStream.Seek(0, SeekOrigin.Begin)
    i += 1


  5. 5

    Replace "FILEPDF" with the location of the PDF file you wish to convert. For instance, if it is a file named "MyDoc.pdf" on your desktop, type "C:\Desktop\MyDoc.pdf".

  6. 6

    Replace "FILETIFF" with the desired name and location of the result image (TIFF) file.

  7. 7

    Hit the "Enter" key.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.