TX Text Control .NET Server

PDF Forms

Topic

Order forms, applications and consent forms often travel as PDF documents that recipients fill in with a PDF reader and send back. TX Text Control .NET Server creates such interactive forms from the form fields of a document, reads the values of the forms that come back and turns filled forms into documents with fixed values. Developers who automate these steps on the server find the complete cycle here, from the first fillable PDF to the archived result.

Form fields as elements of a document, and the code that inserts them, are covered in Form Fields in Document Processing. Users design forms in the Document Editor and fill them in the Document Viewer.

How PDF Forms Work in TX Text Control

A PDF form goes through these steps:

  1. Design. A template contains form fields: text boxes, check boxes, drop-down lists, combo boxes and date fields, created in code, in MS Word or in the Document Editor.
  2. Create. Saved with StreamType.AdobePDF, the form fields become AcroForm fields, the interactive fields of the PDF format, with their names and values. A mail merge can fill in values beforehand.
  3. Fill in. Users fill in the form in Adobe Acrobat Reader, in a browser or in the Document Viewer.
  4. Read. Forms.GetAcroFormFields returns the fields of the returned PDF with their values, which your code stores as JSON, in a data model or as XFDF.
  5. Finalize. The values go into your template of the form, the form fields are flattened into text and the document is archived as PDF/A or signed.

TX Text Control reads the form fields of existing PDF documents but doesn't write values into them. A PDF with new or changed values is always created from a template.

Find the Right Page

If you want toRead
Create a fillable PDF from form fields or a DOCX form, and understand the classes of PDF form fieldsAcroForms
Read the values of filled PDF forms, accept uploaded forms and fill a template with the valuesImport Form Data
Exchange form values as XFDF filesExport XFDF
Replace form fields with their values before a document is archived, sent or signedFlatten Forms

Where to Start

  1. Form Fields: create the form fields of a template, if you haven't worked with them yet.
  2. AcroForms: what a fillable PDF contains.
  3. Import Form Data: get the values back into your application.
  4. Flatten Forms: finish the document.