Form creation
Populate a vendor form
Use one Word-compatible form template to produce either an interactive PDF or a final flattened document.
Output behaviorChoose the PDF form mode
Keep the fields editable or replace them with permanent content.
Step 2
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Create interactive and flattened PDF forms
A TX Text Control template can contain Word-compatible form fields that are exported as interactive PDF AcroForm controls.
Preselect mode supplies initial values while preserving the fields for the recipient. Replace mode converts those values into static document content for archival or final distribution.
API used
MailMerge.FormFieldMergeType
Key members
FormFieldMergeType controls whether merged values initialize interactive form fields or replace them with permanent content.
using var mailMerge = new MailMerge
{
TextComponent = textControl,
FormFieldMergeType = request.Flatten
? FormFieldMergeType.Replace
: FormFieldMergeType.Preselect
};
mailMerge.MergeObject(new
{
vendor_name = request.VendorName.Trim(),
vendor_address = request.VendorAddress.Trim()
});
How it works
The controller loads the vendor form template, merges the submitted values, and selects FormFieldMergeType.Preselect for an interactive form or FormFieldMergeType.Replace for flattened output.
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Displays supported document and PDF formats in the browser.
dotnet add package TXTextControl.Web.DocumentViewer --version 34.2.0
Source files
See the implementation
The complete demo is encapsulated in Demos/Pdf/FormsProcessing/FormsCreation.