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

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

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

How to read form values from PDF form in VB.NET with ByteScout PDF SDK

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

This sample source code below will demonstrate you how to read form values from PDF form in VB.NET. ByteScout PDF SDK is the library for pdf documents generation, modification and updates. Can also generate and fill PDF forms. Provides support for text (fonts, style, size, font family), layers, pdf form fields, vector and raster drawings and you can use it to read form values from PDF form with VB.NET.

Fast application programming interfaces of ByteScout PDF SDK for VB.NET plus the instruction and the code below will help you quickly learn how to read form values from PDF form. Just copy and paste the code into your VB.NET application’s code and follow the instruction. You can use these VB.NET sample examples in one or many applications.

ByteScout PDF SDK free trial version is available on our website. VB.NET and other programming languages are supported.

Try it today: Get 60 Day Free Trial or sign up for Web API

Program.vb
      
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to get PDF form values programmatically. ''' </summary> Class Program Shared Sub Main() ' Load PDF form Dim pdfDocument = New Document("form.pdf") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" Dim page = pdfDocument.Pages(0) ' Get widget by its name and get value Dim box1 = DirectCast(page.Annotations("editBox1"), EditBox).Text Dim box2 = DirectCast(page.Annotations("editBox2"), EditBox).Text Dim checkBox1 = DirectCast(page.Annotations("checkBox1"), CheckBox).Checked ' Cleanup pdfDocument.Dispose() ' Writing values to console Console.WriteLine("Form values are as follows:") Console.WriteLine(box1) Console.WriteLine(box2) Console.WriteLine(checkBox1) Console.WriteLine() Console.WriteLine("Press any key to exit....") Console.ReadLine() End Sub End Class

Try it today: Get 60 Day Free Trial or sign up for Web API

ReadForm.sln
      
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.28010.2003 MinimumVisualStudioVersion = 10.0.40219.1 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ReadForm", "ReadForm.vbproj", "{951C634C-4684-40A5-919C-741C5CA61EA4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {951C634C-4684-40A5-919C-741C5CA61EA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {951C634C-4684-40A5-919C-741C5CA61EA4}.Debug|Any CPU.Build.0 = Debug|Any CPU {951C634C-4684-40A5-919C-741C5CA61EA4}.Release|Any CPU.ActiveCfg = Release|Any CPU {951C634C-4684-40A5-919C-741C5CA61EA4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FD305C5A-563D-4A00-ABC4-AD68B49DD925} EndGlobalSection EndGlobal

Try it today: Get 60 Day Free Trial or sign up for Web API

ReadForm.vbproj
      
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid> <OutputType>Exe</OutputType> <StartupObject>Sub Main</StartupObject> <RootNamespace>ReadForm</RootNamespace> <AssemblyName>ReadForm</AssemblyName> <FileAlignment>512</FileAlignment> <MyType>Console</MyType> <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <DefineDebug>true</DefineDebug> <DefineTrace>true</DefineTrace> <OutputPath>bin\Debug\</OutputPath> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> <DefineDebug>false</DefineDebug> <DefineTrace>true</DefineTrace> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> </PropertyGroup> <PropertyGroup> <OptionExplicit>On</OptionExplicit> </PropertyGroup> <PropertyGroup> <OptionCompare>Binary</OptionCompare> </PropertyGroup> <PropertyGroup> <OptionStrict>Off</OptionStrict> </PropertyGroup> <PropertyGroup> <OptionInfer>On</OptionInfer> </PropertyGroup> <ItemGroup> <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> </ItemGroup> <ItemGroup> <Import Include="Microsoft.VisualBasic" /> <Import Include="System" /> <Import Include="System.Collections" /> <Import Include="System.Collections.Generic" /> <Import Include="System.Data" /> <Import Include="System.Diagnostics" /> </ItemGroup> <ItemGroup> <Compile Include="Program.vb" /> </ItemGroup> <ItemGroup> <Content Include="form.pdf"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project>

Try it today: Get 60 Day Free Trial or sign up for Web API

MORE INFORMATION

Get 60 Day Free Trial or Visit ByteScout PDF SDK page

Explore ByteScout PDF SDK documentation

WEB API VERSION

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next