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

With GemBox.Pdf you can fill in various types of form fields, such as text, radio button, check box, combo box, and list box in C# and VB.NET, as shown in the following example.

using GemBox.Pdf;

// If using the Professional version, put your serial key below.
ComponentInfo.SetLicense("FREE-LIMITED-KEY");

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");
}
Imports GemBox.Pdf

Module Program

Sub Main()

' If using the Professional version, put your serial key below.
ComponentInfo.SetLicense("FREE-LIMITED-KEY")

Using 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" & vbCr & "Notes second line" & vbCr & "Notes third line"

document.Save("FormFilled.pdf")
End Using
End Sub
End Module
A PDF interactive form filled in with GemBox.Pdf
Screenshot of an interactive PDF form filled in with GemBox.Pdf

The example above doesn't fill in a signature field. Signature field fill-in and customization is shown in the example examples.

The example example shows how to read values and the example example shows how to export values of filled-in form fields using GemBox.Pdf.

Next steps

GemBox.Pdf is a .NET library that enables developers to read, merge and split PDF files or execute low-level object manipulations from .NET applications in a simple and efficient way.