ByteScout PDF Suite - C# - Fill form w-4 with pdf sdk - ByteScout

ByteScout PDF Suite – C# – Fill form w-4 with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – C# – Fill form w-4 with pdf sdk

fill form w 4 with pdf sdk in C# and ByteScout PDF Suite

Build fill form w 4 with pdf sdk in C#

:

Step-by-step instructions on how to do fill form w 4 with pdf sdk in C#

Easy to understand coding instructions are written to assist you to try-out the features without the requirement to write your own code. Fill form w 4 with pdf sdk in C# can be applied with ByteScout PDF Suite. ByteScout PDF Suite is the set that includes 6 SDK products to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript.

If you want to quickly learn then these fast application programming interfaces of ByteScout PDF Suite for C# plus the guideline and the C# code below will help you quickly learn fill form w 4 with pdf sdk. Follow the steps-by-step instructions from the scratch to work and copy and paste code for C# into your editor. Updated and detailed documentation and tutorials are available along with installed ByteScout PDF Suite if you’d like to learn more about the topic and the details of the API.

ByteScout PDF Suite free trial version is available for download from our website. Free trial also includes programming tutorials along with source code samples.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.Collections.Generic; using System.Diagnostics; using Bytescout.PDF; namespace FillFormExample { /// <summary> /// This example demonstrates how to fill PDF form programmatically. /// </summary> class Program { static void Main() { // Map of form fields and sample values to set Dictionary<string, object> fieldMap = new Dictionary<string, object>() { { "f1_01[0]", "John J" }, // FirstName and middle initial { "f1_02[0]", "Smith" }, // LastName { "f1_03[0]", "111-111-3333" }, // Security number { "f1_04[0]", "12 Palm st., Hill Valley" }, // Home address { "f1_05[0]", "CA 12345" }, // City, Town, State and ZIP { "c1_1[1]", "True" }, // Married { "f1_06[0]", "123" }, // Total number of allowance { "f1_07[0]", "443.44" }, // Additional amount { "f1_09[0]", "Google, Somewhere in CA" }, // Employer's name and address { "f1_10[0]", "12-3-2012" }, // First date of employment { "f1_11[0]", "EMP223344" } // Employer identification number }; // Load PDF form Document pdfDocument = new Document(@".\W-4.pdf"); pdfDocument.RegistrationName = "demo"; pdfDocument.RegistrationKey = "demo"; // Get first page Page page = pdfDocument.Pages[0]; // Get widget by its name and change value foreach (KeyValuePair<string, object> keyValuePair in fieldMap) { Annotation annotation = page.Annotations[keyValuePair.Key]; if (annotation is CheckBox) { ((CheckBox)annotation).Checked = Convert.ToBoolean(keyValuePair.Value); } else if (annotation is EditBox) { ((EditBox)annotation).Text = (string)keyValuePair.Value; } } // Save modified document pdfDocument.Save("result.pdf"); // Cleanup pdfDocument.Dispose(); // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next