Convert PDF to Image file from VB.NET, Reference to pdf2image.dll from VB.NET

VeryPDF PDF to Image Converter SDK can be called from VB.NET source code, please refer to an example of VB.NET calling source code at below,

Public Class PDF2ImageConverter

    Private Declare Function PDFToImageConverter Lib "pdf2image.dll"
    (ByVal szPDFFileName As String, ByVal szOutputName As String,
    ByVal szUserPassword As String, ByVal szOwnPassword As String,
    ByVal xresolution As Integer, ByVal yresolution As Integer, ByVal bitcount As Integer,
    ByVal compression As Integer, ByVal quality As Integer, ByVal grayscale As Integer,
    ByVal multipage As Integer, ByVal firstPage As Integer, ByVal lastPage As Integer) As Integer

    Private Declare Sub PDFToImageSetCode Lib "pdf2image.dll" (ByVal szRegcode As String)

    Public Enum CompressionType
        COMPRESSION_NONE = 1              '/* dump mode */
        COMPRESSION_CCITTRLE = 2          '/* CCITT modified Huffman RLE */
        COMPRESSION_CCITTFAX3 = 3         '/* CCITT Group 3 fax encoding */
        COMPRESSION_CCITTFAX4 = 4         '/* CCITT Group 4 fax encoding */
        COMPRESSION_LZW = 5               '/* Lempel-Ziv  & Welch */
        COMPRESSION_JPEG = 7              '/* JPEG DCT compression */
        COMPRESSION_PACKBITS = 32773      '/* Macintosh RLE */
    End Enum

    Public Sub New()

    End Sub

    Public Function ConvertPDFToImage(ByVal strInputPDF As String, ByVal strOutputImage As String, ByVal strUsername As String, ByVal strPassword As String,
    ByVal lngXDPI As Long, ByVal lngYDPI As Long, ByVal lngBitCount As Long,
    ByVal enumCompression As CompressionType, ByVal lngQuality As Long,
    ByVal blnGreyscale As Boolean, ByVal blnMultipage As Boolean,
    ByVal lngFirstPage As Long, ByVal lngLastPage As Long) As Long

        ' Register PDF to Image Converter Library

        ConvertPDFToImage = PDFToImageConverter(strInputPDF, strOutputImage, strUsername, strPassword, lngXDPI, lngYDPI, lngBitCount, enumCompression, lngQuality, blnGreyscale, blnMultipage, lngFirstPage, lngLastPage)

    End Function

End Class

Please notice, in the VB.NET code, you need change long data type to Integer data type.

VN:F [1.9.20_1166]
Rating: 7.5/10 (2 votes cast)
VN:F [1.9.20_1166]
Rating: +1 (from 1 vote)
Convert PDF to Image file from VB.NET, Reference to pdf2image.dll from VB.NET, 7.5 out of 10 based on 2 ratings

Related Posts

One Reply to “Convert PDF to Image file from VB.NET, Reference to pdf2image.dll from VB.NET”

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!