ByteScout PDF SDK - C# - Read Form Values from PDF form - ByteScout

ByteScout PDF SDK – C# – Read Form Values from PDF form

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – C# – Read Form Values from PDF form

How to read form values from PDF form in C# with ByteScout PDF SDK

Write code in C# to read form values from PDF form with this step-by-step tutorial

The code below will help you to implement an C# app to read form values from PDF form. What is ByteScout PDF SDK? It is the pdf library that can create, update and modify PDF files. Supports text with fonts and style selections, layers, form fields, drawing lines and objects, automatic tables, images. Can be used to create and fill pdf forms. It can help you to read form values from PDF form in your C# application.

You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout PDF SDK for read form values from PDF form below and use it in your application. In order to implement the functionality, you should copy and paste this code for C# below into your code editor with your app, compile and run your application. Enjoy writing a code with ready-to-use sample C# codes.

Free trial version of ByteScout PDF SDK is available for download from our website. Get it to try other source code samples for C#.

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

Program.cs
      
using Bytescout.PDF; using System; namespace ReadForm { class Program { static void Main(string[] args) { // Load PDF form Document pdfDocument = new Document(@"form.pdf"); pdfDocument.RegistrationName = "demo"; pdfDocument.RegistrationKey = "demo"; Page page = pdfDocument.Pages[0]; // Get widget by its name and get value string box1 = ((EditBox) page.Annotations["editBox1"]).Text; string box2 = ((EditBox) page.Annotations["editBox2"]).Text; bool checkBox1 = ((CheckBox) page.Annotations["checkBox1"]).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(); } } }

Try ByteScout PDF 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 SDK page

Explore ByteScout PDF SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next