Reading Form Fields in PDF (.NET Core/Framework)
Reading Form Fields in a PDF using DynamicPDF Core Suite is straightforward.
How to Read Form Fields in C#
The following steps and sample code illustrates reading Form Fields in a PDF using DynamicPDF Core Suite.
Steps for Reading Form Fields in PDF
- Create a
MergeDocument
object with the desired pdf. - Set the Acro Form field values to local variables.
- Save the PDF document.
Sample Code - C#
MergeDocument document = new MergeDocument( "output.pdf" );
string textBox1Value = document.Form.Fields["TextBox1"].Value;
string checkBox1Value = document.Form.Fields["CheckBox1"].Value;
string comboBox1Value = document.Form.Fields["ComboBox1"].Value;
string radioButton1Value = document.Form.Fields["RadioButton1"].Value;
string listBox1Value = document.Form.Fields["ListBox1"].Value;
GitHub Project
Clone or view the example project at GitHub. This example code is contained in the Examples/ReadFormFieldsExample.cs file.
Getting Started
NuGet Package
DynamicPDF Core Suite is available on NuGet and is part of the ceTe.DynamicPDF.CoreSuite.NET
package. The easiest way to install the package is through the Visual Studio Package Manager. You can also download the package directly from NuGet.
DynamicPDF Core Suite Information
More information can be found on the DynamicPDF Core Suite webpage.
Available on Other Platforms
DynamicPDF Core Suite is available for the Java and COM/ActiveX platforms. Refer to the respective product pages for more details.
- Java - DynamicPDF Generator for Java
- COM/ActiveX - DynamicPDF Generator for COM/ActiveX