Logo
My Account |  Site Map | Contact Us  
 The same content in Microsoft HTML help file format is included in the download package.
Filling In Form Fields

EO.Pdf can load a PDF file with fill-in form, fill the form fields and then save the filled document. The following sample demonstrates how to do this:

//Load the PDF file
PdfDocument doc = new PdfDocument("c:\\registration.pdf");

//Get the First_Name field
PdfField field = doc.Fields["First_Name"];

//Set the field value
field.Value = "John";

//Save it back
doc.Save("c:\\registration.pdf");

Optionally, you can also change the field's font and color. A different font and color can be used to indicate that a form field has already been filled in. The following code changes "First_Name"'s font to Arial and its color to blue:

//Change the field's font and color
field.Font = new PdfFont("Arial", 12);
field.Color = Color.Blue;

Direct link to this topic