barcode reader API in VB.NET using PDF.co Web API

How to code barcode reader API in VB.NET: How-To tutorial

Every ByteScout tool contains example VB.NET source codes that you can find here or in the folder with installed ByteScout product. PDF.co Web API was made to help with barcode reader API in VB.NET. PDF.co Web API is the Rest API that provides set of data extraction functions, tools for documents manipulation, splitting and merging of pdf files. Includes built-in OCR, images recognition, can generate and read barcodes from images, scans and pdf.

The SDK samples like this one below explain how to quickly make your application do barcode reader API in VB.NET with the help of PDF.co Web API. In order to implement this functionality, you should copy and paste code below into your app using code editor. Then compile and run your application. Use of PDF.co Web API in VB.NET is also explained in the documentation included along with the product.

Visit our website provides for free trial version of PDF.co Web API. Free trial includes lots of source code samples to help you with your VB.NET project.

Try PDF.co Web API today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

Module1.vb
      
Imports System.IO Imports System.Net Imports Newtonsoft.Json.Linq Module Module1 ' The authentication key (API Key). ' Get your own by registering at https://app.pdf.co/documentation/api Const API_KEY As String = "***********************************" ' Direct URL of source file to search barcodes in. Const SourceFileURL As String = "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf" ' Comma-separated list of barcode types to search. ' See valid barcode types in the documentation https://app.pdf.co/documentation/api/1.0/barcode/read_from_url.html Const Pages As String = "" ' Sample profile that sets advanced conversion options ' Advanced options are properties of Reader class from Bytescout BarCodeReader used in the back-end: ' https//cdn.bytescout.com/help/BytescoutBarCodeReaderSDK/html/ba101d21-3db7-eb54-d112-39cadc023d02.htm ReadOnly Profiles = File.ReadAllText("profile.json") Sub Main() ' Create standard .NET web client instance Dim webClient As WebClient = New WebClient() ' Set API Key webClient.Headers.Add("x-api-key", API_KEY) ' Prepare URL for `Barcode Reader` API call Dim query As String = Uri.EscapeUriString(String.Format( "https://api.pdf.co/v1/barcode/read/from/url?pages={0}&url={1}&profiles={2}", Pages, SourceFileURL, Profiles)) Try ' Execute request Dim response As String = webClient.DownloadString(query) ' Parse JSON response Dim json As JObject = JObject.Parse(response) If json("error").ToObject(Of Boolean) = False Then ' Display found barcodes in console For Each token As JToken In json("barcodes") Console.WriteLine("Found barcode:") Console.WriteLine(" Type: " + token("TypeName").ToString()) Console.WriteLine(" Value: " + token("Value").ToString()) Console.WriteLine(" Document Page Index: " + token("Page").ToString()) Console.WriteLine(" Rectangle: " + token("Rect").ToString()) Console.WriteLine(" Confidence: " + token("Confidence").ToString()) Console.WriteLine() Next Else Console.WriteLine(json("message").ToString()) End If Catch ex As WebException Console.WriteLine(ex.ToString()) End Try webClient.Dispose() Console.WriteLine() Console.WriteLine("Press any key...") Console.ReadKey() End Sub End Module

Try PDF.co Web API today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

packages.config
      
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net40" /> </packages>

Try PDF.co Web API today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

VIDEO

ON-PREMISE VERSION INFORMATION

Get 60 Day Free Trial or Visit PDF.co Web API Home Page

Explore PDF.co Web API Documentation

Get PDF.co Web API Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Related Samples: