PDF .NET Library Logo
Home Products Code Library Online Demos Support Forum Buy About Us  
Code Library

Filling PDF Acro Forms

The following code snippet fills an Acro Form called "fw9.pdf" and creates a new PDF called "formfill.pdf"

c# sample:

PDFDocument doc = new PDFDocument("formfill.pdf");

string formFile = ("fw9.pdf");

doc.Pages.Delete(doc.CurrentPage);

doc.LoadPdf(formFile,"");

(doc.AcroForm.Fields["f1_01(0)"] as PDFEdit).Text = "Jim Smith";

(doc.AcroForm.Fields["f1_02(0)"] as PDFEdit).Text = "Acme Corp. Inc.";

(doc.AcroForm.Fields["c1_01(0)"] as PDFCheckBox).Checked = true;

(doc.AcroForm.Fields["c1_02(0)"] as PDFCheckBox).Checked = false;

doc.AcroForm.FlattenFormFields=true;

doc.Save();

 

 

Back to PDF Code Library