ByteScout PDF Extractor SDK - VB.NET - Read Values from Form Fields - ByteScout

ByteScout PDF Extractor SDK – VB.NET – Read Values from Form Fields

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – VB.NET – Read Values from Form Fields

How to read values from form fields in VB.NET using ByteScout PDF Extractor SDK

Write code in VB.NET to read values from form fields with this step-by-step tutorial

The code below will help you to implement an VB.NET app to read values from form fields. ByteScout PDF Extractor SDK is the Software Development Kit (SDK) that is designed to help developers with data extraction from unstructured documents like pdf, tiff, scans, images, scanned and electronic forms. The library is powered by OCR, computer vision and AI to provide unique functionality like table detection, automatic table structure extraction, data restoration, data restructuring and reconstruction. Supports PDF, TIFF, PNG, JPG images as input and can output CSV, XML, JSON formatted data. Includes full set of utilities like pdf splitter, pdf merger, searchable pdf maker. It can be used to read values from form fields using VB.NET.

This rich sample source code in VB.NET for ByteScout PDF Extractor SDK includes the number of functions and options you should do calling the API to read values from form fields. In order to implement the functionality, you should copy and paste this code for VB.NET below into your code editor with your app, compile and run your application. This basic programming language sample code for VB.NET will do the whole work for you to read values from form fields.

Download free trial version of ByteScout PDF Extractor SDK from our website with this and other source code samples for VB.NET.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.vb
      
Imports System.Xml Imports Bytescout.PDFExtractor Module Program Sub Main() Try ' Create XMLExtractor interface Using extractor As New XMLExtractor("demo", "demo") ' Load Sample PDF document extractor.LoadDocumentFromFile("filled_form.pdf") ' Get PDF document text as XML Dim xmlText As String = extractor.GetXML ' Load XML Dim xmlDocument As XmlDocument = New XmlDocument xmlDocument.LoadXml(xmlText) ' Select all "control" nodes Dim formControls As XmlNodeList = xmlDocument.SelectNodes("//control") If (Not (formControls) Is Nothing) Then For Each formControl As XmlNode In formControls Dim typeAttribute As XmlAttribute = formControl.Attributes("type") ' Get filled textboxes If (typeAttribute.Value = "editbox") Then If Not String.IsNullOrEmpty(formControl.InnerText) Then Console.WriteLine(("EDITBOX " + (formControl.Attributes("id").Value + (": " + formControl.InnerText)))) End If End If ' Get checked checkboxes If (typeAttribute.Value = "checkbox") Then If (formControl.Attributes("state").Value = "1") Then Console.WriteLine(("CHECKBOX " _ + (formControl.Attributes("id").Value + (": " + formControl.Attributes("state").Value)))) End If End If Next End If End Using Catch ex As Exception Console.WriteLine(ex.Message) End Try Console.WriteLine() Console.WriteLine("Press any key to exit...") Console.ReadLine() End Sub End Module

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next