PDF to Image - pqScan.com
VB.NET PDF to Custom Size Images Converting PDF into Specific size Images in Visual Basic.NET Online Demo Download Trial Purchase Now
C#.NET
VB.NET

How to Specify Images Converted through PDF in VB.NET?

back to home  >  PDF to Image SDK  >  How to Convert PDF to Image  >  Convert PDF to Custom Size Images

There are two ways to type images from PDF in a custom size and definition. One is to set DPI property, the other is to change the width and height of output image. Please note that, in pqScan PDF To Image SDK, the DPI is 72 for default.

User-defined Image Size (PDF to single page type image) -- Visual Basic.NET sample

Changing DPI and specifying each page size of PDF are both supplied for PDF to single page type images(jpg, tiff, bmp, png, gif).

Imports System.Drawing
Imports System.Drawing.Imaging
Imports PQScan.PDFToImage

Namespace SpecifyImageSize
  Class Program
    Private Shared Sub Main(args As String())
      ' Create an instance of PQScan.PDFToImage.PDFDocument object.
      Dim pdfDoc As New PDFDocument()

      ' Load PDF document.
      pdfDoc.LoadPDF("sample.pdf")

      ' Set dpi to render image
      pdfDoc.DPI = 96

      'Get total page count.
      Dim count As Integer = pdfDoc.PageCount

      For i As Integer = 0 To count - 1
        'Convert page to image in target size
        Dim bmp As Bitmap = pdfDoc.ToImage(i, 100, 200)
        'Save image 
        bmp.Save("output" & i & ".jpg", ImageFormat.Jpeg)
      Next
    End Sub
  End Class
End Namespace

User-defined Image Size (PDF to multiple page type image) -- VB .NET sample

Only customizing DPI is supplied for PDF to multi-page tiff. So you can't resize each page to image, just get one whole tiff image in different dpi.

Imports PQScan.PDFToImage

Namespace SpecifyImageSize
  Class Program
    Private Shared Sub Main(args As String())
      ' Create an instance of PQScan.PDFToImage.PDFDocument object.
      Dim pdfDoc As New PDFDocument()

      ' Load PDF document.
      pdfDoc.LoadPDF("sample.pdf")

      ' Set dpi to render whole image
      pdfDoc.DPI = 96

      ' Save multi-page tiff
      pdfDoc.ToMultiPageTiff("multipage.tiff")
    End Sub
  End Class
End Namespace
pqScan SDK
.NET DLL for PDF to Image
Online Guide
.NET Guide for PDF to Image
Conversion Type
ASP.NET PDF to PNG Conversion Guide ASP.NET PDF to JPEG Conversion Guide VB.NET PDF to JPEG Conversion Guide C# PDF to Multi-page TIFF Conversion Guide C# PDF to GIF Conversion Guide C# PDF to BMP Conversion Guide .NET PDF to BMP Conversion Guide .NET PDF to PNG Conversion Guide View All Image Types >>
It is a true pleasure for us to use your product in our program. We have been impressed with the excellent SDK, quick response and professional approach your company has offered us. Marshall