BCL Technologies

A PDFTron Company

we know PDF ..... inside and out


Process PDF Form Fields in C#


  • Extract, insert, and update data in PDF Forms.

Code Snippet

Download the input.pdf form (line 27 below)

  1. // this example takes the first two fields in a PDF template
  2. // which are Name and Address and populates them with values
  3. // of "BCL Technologies" and "Santa Clara, CA"
  4. Type type = Type.GetTypeFromProgID("easyPDF.Loader.7");
  5. Loader oLoader = (Loader)Activator.CreateInstance(type);
  6. PDFDocument oDocument =
  7. oDocument.Open(Server.MapPath(@".\input.pdf"));
  8. // get all form fields from the PDF
  9. FormFields oFormFields = oDocument.FormFields;
  10. // get the first form field
  11. FormField oFormField = oFormFields[0];
  12. TextField oTextField;
  13. if (oFormField.Type == docFormFieldType.DOC_FRMTYPE_TEXT && oFormField.Name == "Name")
  14. {
  15. // set Name to "BCL Technologies"
  16. oTextField = (TextField)oFormField;
  17. oTextField.Value = "BCL Technologies";
  18. }
  19. // get the second form field
  20. oFormField = oFormFields[1];
  21. if (oFormField.Type == docFormFieldType.DOC_FRMTYPE_TEXT && oFormField.Name == "Address")
  22. {
  23. // set Address to "Santa Clara, CA"
  24. oTextField = (TextField)oFormField;
  25. oTextField.Value = "Santa Clara, CA";
  26. }
  27. oDocument.SaveAs(Server.MapPath(@".\output.pdf "));

Request Pricing

QuickStart Video

Watch a QuickStart Video to see how easy it is to convert Word to PDF.

easyPDF SDK: As easy as 1-2-3

Complete PDF Features

“easyPDF SDK setup was very straightforward, unlike our experience with other products. We wrote just a few lines of code to start using it.” Read the case study

"We evaluated many PDF tools and drivers. We even wrote our own. Except for BCL's easyPDF SDK, all had limitations we couldn’t live with. Some only converted from MS Office and not very well. Others could not do annotation or text stamping on PDF documents. None were as easy to use and as easy to integrate." Read the case study

© 1993 - , BCL Technologies.

All other trademarks are the property of their respective owners.