PDF to Image - pqScan.com
VB.NET Image to PDF Adding Image to PDF document in VB.NET Online Demo Download Trial Purchase Now
C#.NET
VB.NET

How to Convert Image to PDF in VB.NET?

back to home  >  Image to PDF SDK  >  How to Convert Image to PDF  >  Convert Image to PDF

The pqScan Image to PDF, as a powerful and professional PDF toolkit, allows developers not only to convert bmp, tiff, jpeg to PDF document, but also to turn png and gif image into PDF file. Once you use our component, you will find it's really an easy and fast way to convert images to PDF pages

Before starting your project, the only thing you need to is download Image to PDF in .NET, and add it to your project reference.

Image to PDF--Visual Basic.NET sample

Users can transform images from local file and stream. And following two examples will introduce how to convert image to PDF document using vb.net sample code.

The first example shows convert BMP images from the disk to PDF stream.

Imports System.IO
Imports PQScan.ImageToPDF

Namespace ImageToPDF
    Class Program
        Private Shared Sub Main(args As String())
            'Create an instance of PQScan.ImageToPDF.PDFConverter object.
            Dim converter As New PDFConverter()

            'Set PDF page layout, if to ImageSize, 
            'PDF page will display the original size and quality of the source image.
            converter.PageSizeType = PageSizeMode.ImageSize

            'Set input image from local files.
            Dim imgFiles As String() = New String(2) {"input1.bmp", "input2.bmp", "input3.bmp"}

            'Set output pdf stream.
            Dim fileStream As New FileStream("bmp-to-pdf.pdf", FileMode.Create)

            'Generate PDF from images.
            converter.CreatePDF(imgFiles, fileStream)
        End Sub
    End Class
End Namespace

The second guide is demonstrating how to convert GIF image from file stream to PDF stream in vb.net.

Imports System.IO
Imports PQScan.ImageToPDF

Namespace ImageToPDF
    Class Program
        Private Shared Sub Main(args As String())
            'Create an instance of PQScan.ImageToPDF.PDFConverter object.
            Dim converter As New PDFConverter()

            'Set PDF page layout, A4 is most widely used.
            converter.PageSizeType = PageSizeMode.A4

            'Set input image from file streams.
            Dim streams As FileStream() = New FileStream(2) {}
            streams(0) = New FileStream("input1.gif", FileMode.Open)
            streams(1) = New FileStream("input2.gif", FileMode.Open)
            streams(2) = New FileStream("input3.gif", FileMode.Open)

            'Set output pdf file stream.
            Dim fileStream As New FileStream("gif-to-pdf.pdf", FileMode.Create)

            'Generate PDF from images.
            converter.CreatePDF(imgFiles, fileStream)
        End Sub
    End Class
End Namespace

convert image(jpg, png, tiff, bitmap, gif) to pdf in vb.net

Image to PDF Append to PDF in VB.NET TIFF to PDF in VB.NET Mixed type to PDF in VB.NET
pqScan file conversion product is top-notch in the market. We are extremely proud of our new project and I highly recommend this to anyone considering building an image-to-pdf project. Dick Konkol