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

VB.NET PDF Image Reader Library
How to extract Image from PDF Document in VB.NET


Support PDF Image Extraction from a Page, a Region on a Page, and PDF Document in VB.NET Project









  • A Visual Studio .NET PDF SDK library, able to perform image extraction from multiple page adobe PDF file in VB.NET
  • Extract multiple types of image from PDF file in VB.NET, like XObject Image, XObject Form, Inline Image, etc
  • View C# tutorial with complete source code at How to read, extract images from PDF using C#
  • Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint
  • Scan high quality image to PDF, tiff and various image formats, including JPG, JPEG, PNG, GIF, TIFF, etc
  • Able to extract images from PDF in both .NET WinForms and ASP.NET project
  • Extract all images from whole PDF or a specified PDF page in VB.NET
  • Capture image from whole PDF based on special characteristics
  • Get image information, such as its location, zonal information, metadata, and so on
  • Extract image from PDF free in .NET framework application with trial SDK components for .NET
  • Online source codes for quick evaluation in VB.NET class


By using RsterEdge XDoc PDF SDK for .NET, VB.NET users are able to extract image from PDF page or file and specified region on PDF page, then get image information for indexing and accessing. More detailed functions are listed below.



imagedraw asp.net multipage tiff viewer, how to show .pdf file in asp.net web application using c#, asp net remove image from pdf, asp.net edit pdf, pdf preview in asp net c# example, asp.net mvc open excel file, free asp. net mvc pdf viewer.





About REImage


Using XDoc.PDF for .NET SDK, you can easily read, extract images from pdf document, page, page region. The extracted images are stored in PDFImage objects.

Class PDFImage includes the following properties and methods

  1. Position: Position of the image in the page. Unit: pixel (in 96 dpi)
  2. IsRotated: Indicate if the image is rotated.
  3. Image: Get the embedded image resource related to this object.
  4. IsInlineImage: Indicate if the resource is an Inline Image.
  5. IsForm: Indicate if the resource is an XObject Form. Return false if the resource is an XObject Image or Inline Image.
  6. IsXObjectForm: Same to IsForm
  7. IsRGB: Indicate if the image is an XObject Image with ColorSpace DeviceRGB.
  8. IsCMYK: Indicate if the image is an XObject Image with ColorSpace DeviceCMYK.
  9. IsGray: Indicate if the image is an XObject Image with ColorSpace DeviceGray.
  10. IsIndexed: Indicate if the image is an XObject Image with ColorSpace Indexed.
  11. IsCIEBased: Indicate if the image is an XObject Image with CIE-based ColorSpace.


  12. RectangleF GetBoundary(): Get boundary of the item in the Device Space (Windows-like coordinate system). Unit: pixel (in 96 dpi)
  13. GetBitmap(): Get appearence of the page item in the Device Space (Windows-like coordinate system).
  14. GetColorSpaceName(): Get Color Space type of the image. Only valid for PDFImageType.XObjImage.




VB.NET extract images from whole pdf document


' open a document
Dim inputFilePath As String = "C:\3.pdf"
Dim doc As PDFDocument = New PDFDocument(inputFilePath)

' extract all images in the document
Dim allImages As List(Of PDFImage) = PDFImageHandler.ExtractImages(doc)

' show information of these images
For Each image As PDFImage In allImages
    Console.WriteLine("Image: page index = {0}", image.PageIndex)
    Console.WriteLine("     : X = {0}, Y = {1}", image.Position.X, image.Position.Y)
    Console.WriteLine("     : X = {0}, Y = {1}", image.GetBoundary().X, image.GetBoundary().Y)
    Console.WriteLine("     : Width = {0}", image.GetBoundary().Width)
    Console.WriteLine("     : Height = {0}", image.GetBoundary().Height)
Next




VB.NET extract images from specified PDF page


' extract all images in the first page
Dim pageIndex As Integer = 0
Dim page As PDFPage = doc.GetPage(pageIndex)
Dim allImagesInPage As List(Of PDFImage) = PDFImageHandler.ExtractImages(page)

' show information of these images
For Each image As PDFImage In allImagesInPage
    Console.WriteLine("Image: page index = {0}", image.PageIndex)
    Console.WriteLine("     : X = {0}, Y = {1}", image.Position.X, image.Position.Y)
    Console.WriteLine("     : X = {0}, Y = {1}", image.GetBoundary().X, image.GetBoundary().Y)
    Console.WriteLine("     : Width = {0}", image.GetBoundary().Width)
    Console.WriteLine("     : Height = {0}", image.GetBoundary().Height)
Next




VB.NET read the image from specified position (coordinates) inside pdf document


XDoc.PDF SDK is using Window Coordinate System.
Points on the screen are described by x- and y-coordinate pairs. The x-coordinates increase to the right; y-coordinates increase from top to bottom. The origin (0,0) is the most left top point on the pdf page.



' open a document
Dim inputFilePath As String = "C:\3.pdf"
Dim doc As PDFDocument = New PDFDocument(inputFilePath)

' get the first page
Dim pageIndex As Integer = 0
Dim page As PDFPage = doc.GetPage(pageIndex)

' select image at the position (100F, 100F) in the page
Dim cursorPos As PointF = New PointF(100.0F, 100.0F)
Dim image As PDFImage = PDFImageHandler.SelectImage(page, cursorPos)
If image Is Nothing Then
    Console.WriteLine("No image has been found!")
Else
    Console.WriteLine("Image: boundary = {0}", image.GetBoundary().ToString())
End If




Read images list from specified area in pdf page


For api: public RectangleF(float x, float y, float width, float height)
(x,y) is the Rectangle left top corner coordicate, width, height are the rectangle's width and height.



' open a document
Dim inputFilePath As String = "C:\3.pdf"
Dim doc As PDFDocument = New PDFDocument(inputFilePath)

' get the first page
Dim pageIndex As Integer = 0
Dim page As PDFPage = doc.GetPage(pageIndex)

' define the region (Rectangle [50F, 50F, 300F, 400F]) of the page
Dim region As RectangleF = New RectangleF(50.0F, 50.0F, 300.0F, 400.0F)

' get all images in the region in sequence (from bottom to top)
Dim images As List(Of PDFImage) = PDFImageHandler.SelectImages(page, region)

' select the top image in the region
Dim image1 As PDFImage = PDFImageHandler.SelectImage(page, region)

' select the bottom image in the region
Dim sequenceIndex As Integer = 0
Dim image2 As PDFImage = PDFImageHandler.SelectImage(page, region, sequenceIndex)