VB.NET PDF: How to HTML5 PDF Viewer PDF Create PDF Export File & Page Process PDF Read PDF Write Form Process Document Protect Annotation & Drawing PDF Print WPF PDF Viewer Work with Other SDKs Barcode Read Barcode Create OCR Twain
Barcode Read
  |  
Home ›› XDoc.PDF ›› VB.NET PDF: Read Barcode

VB.NET PDF - How to Decode Barcode from PDF in VB.NET


VB.NET Guide for Decoding Linear and 2D Barcodes from PDF in VB.NET Class




Overview



One of the solutions by which you can use to improve your PDF document reading with high capacity is to embed a barcode reader add-on. And here, we specifically recommend this VB.NET PDF barcode reading application to you. This PDF barcode decoding library SDK for VB.NET class is exclusively designed for detecting and reading most common linear and two-dimensional barcode symbols from PDF document using VB.NET methods.




VB.NET Code: Read Barcode from PDF Document



Add necessary references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Raster.dll


  RasterEdge.XDoc.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll


  RasterEdge.Imaging.Barcode.Scanner.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PDF;


  using RasterEdge.Imaging.Barcode.Scanner;


Code sample listed below illustrate how to read barcode images from PDF file in VB.NET project.




Dim inputFilePath As String = Program.RootPath + "\\" + "1_barcode.pdf"

' open the document
Dim doc As PDFDocument = New PDFDocument(inputFilePath)
Dim page As PDFPage = doc.GetPage(0)

' set the reading settings
Dim settings As ReaderSettings = New ReaderSettings()
settings.AddTypesToRead(RasterEdge.Imaging.Barcode.Scanner.BarcodeType.Code128)

' read the barcodes in the page
Dim barcodes As Barcode() = BarcodeReader.ReadBarcodes(settings, page)
For Each barcode As Barcode In barcodes
    Console.WriteLine("Message:  " + barcode.DataString)
    Console.WriteLine("Location: " + barcode.BoundingRectangle.ToString())
Next