Fill in PDF interactive forms in C# and VB.NET

PDF .Net supports filling in a PDF interactive form and it automatically updates the appearance of the filled in fields.

Various types of form fields, such as text, radio button, check box, combo box, and list box can be filled in uniformly, using the PdfField.Value property, as shown in the following example.

Complete code

using System;
using SautinSoft.Pdf;
using System.IO;

class Program
{
	static void Main()
	{
		// This property is necessary only for licensed version.
		//SautinSoft.Pdf.Serial = "XXXXXXXXXXX";

		using (var document = PdfDocument.Load("Form.pdf"))
		{
			document.Form.Fields["FullName"].Value = "Jane Doe";
			document.Form.Fields["ID"].Value = "0123456789";
			document.Form.Fields["Gender"].Value = "Female";
			document.Form.Fields["Married"].Value = "Yes";
			document.Form.Fields["City"].Value = "Berlin";
			document.Form.Fields["Language"].Value = new string[] { "German", "Italian" };
			document.Form.Fields["Notes"].Value = "Notes first line\rNotes second line\rNotes third line";

			document.Save("FormFilled.pdf");
		}
	}
}

            

Download.


If you need a new code example or have a question: email us at support@sautinsoft.com or ask at Online Chat (right-bottom corner of this page) or use the Form below:



Questions and suggestions from you are always welcome!

We are developing .Net components since 2002. We know PDF, DOCX, RTF, HTML, XLSX and Images formats. If you need any assistance with creating, modifying or converting documents in various formats, we can help you. We will write any code example for you absolutely free.