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.

Try ByteScout PDF Extractor SDK today: Get 60 Day Free Trial or sign up for Web API

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

Try ByteScout PDF Extractor SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout PDF Extractor SDK page

Explore ByteScout PDF Extractor SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next