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

ByteScout PDF SDK – C# – Read Form Values from W-4 form

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

How to read form values from W 4 form in C# using ByteScout PDF SDK

The tutorial shows how to read form values from W 4 form in C#

Learn how to read form values from W 4 form in C# with this source code sample. ByteScout PDF SDK is the component to help programmers in generating new pdf files, modifying and updating existing pdf documents or pdf forms. Provides support for auto-filling pdf forms, adding text with adjustable font, style, size, font family, new form fields, vector and raster drawings and you can use it to read form values from W 4 form with C#.

C# code samples for C# developers help to speed up coding of your application when using ByteScout PDF SDK. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Test C# sample code examples whether they respond your needs and requirements for the project.

Free trial version of ByteScout PDF SDK is available on our website. Documentation and source code samples are included.

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(@"W-4_Filled.pdf"); pdfDocument.RegistrationName = "demo"; pdfDocument.RegistrationKey = "demo"; Page page = pdfDocument.Pages[0]; Console.WriteLine("W-4 Form values are as follows"); // FirstName and middle initial var cFirstName = ((EditBox)page.Annotations["f1_01[0]"]).Text; Console.WriteLine({code}quot;FirstName: {cFirstName}"); // LastName var cLastName = ((EditBox)page.Annotations["f1_02[0]"]).Text; Console.WriteLine({code}quot;LastName: {cLastName}"); // Security Number var cSecurityNumber = ((EditBox)page.Annotations["f1_03[0]"]).Text; Console.WriteLine({code}quot;Security Number: {cSecurityNumber}"); // Home Address var cHomeAddress = ((EditBox)page.Annotations["f1_04[0]"]).Text; Console.WriteLine({code}quot;Home Address-1: {cHomeAddress}"); // Home Address 2 var cHomeAddress2 = ((EditBox)page.Annotations["f1_05[0]"]).Text; Console.WriteLine({code}quot;Home Address-2: {cHomeAddress2}"); // Is Married var bIsMarried = ((CheckBox)page.Annotations["c1_1[1]"]).Checked; Console.WriteLine({code}quot;Is Married: {bIsMarried}"); // Cleanup pdfDocument.Dispose(); 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