# Creating Adobe PDF Forms in C#

> Interactive forms in an Adobe PDF document can be used to gather information from end-users. This article shows how to create those forms using TX Text Control in .NET applications using C#.

- **Author:** Bjoern Meyer
- **Published:** 2021-02-10
- **Modified:** 2026-07-17
- **Description:** Interactive forms in an Adobe PDF document can be used to gather information from end-users. This article shows how to create those forms using TX Text Control in .NET applications using C#.
- **3 min read** (547 words)
- **Tags:**
  - AcroForms
  - Angular
  - ASP.NET
  - DS Server
  - PDF
- **Web URL:** https://www.textcontrol.com/blog/2021/02/10/creating-adobe-pdf-forms-in-csharp/
- **LLMs URL:** https://www.textcontrol.com/blog/2021/02/10/creating-adobe-pdf-forms-in-csharp/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2021/02/10/creating-adobe-pdf-forms-in-csharp/llms-full.txt

---

TX Text Control provides a comprehensive way to create documents with fillable form elements such as form text boxes, check box fields and drop-down elements. Documents with form elements such as form text boxes, check box fields, drop-downs and date picker elements can be created like mail merge templates and dynamically pre-completed with known values. This helps to generate custom forms where some fields are already completed with known values to accelerate the completion process and to improve the user experience.

Using TX Text Control, PDF documents can be easily created, shared and collected in business applications. PDF forms with fillable form elements can be created and collected by reading the completed documents in order to analyze and store the data.

### Creating the PDF Programmatically

This article shows how to create a PDF document with AcroForms that can be completed in document viewers such as Adobe Acrobat Reader. At least a trial version of [TX Text Control .NET Server](https://www.textcontrol.com/product/tx-text-control-dotnet-server/) is required for this tutorial.

1. In Visual Studio, create a new C# Console App (.NET Framework).
    
    ![Creating forms](https://s1-www.textcontrol.com/assets/dist/blog/2021/02/10/a/assets/step1.webp "Creating forms")
2. Select *Add Reference...* from the *Project* main menu. In the opened dialog, choose *Browse...* and browse for the TX Text Control assemblies *TXTextControl.dll* and *TXTextControl.Server.dll* from the TX Text Control installation folder (default: *C:\\Program Files\\Text Control GmbH\\TX Text Control 29.0.NET Server for ASP.NET\\Assembly*). Select both assemblies and confirm with *Add*. Close the dialog by clicking *OK*.
3. In the *Solution Explorer*, select *Properties* and choose *Add New Item...* from the *Project* main menu. Select *Text File* as the template, name it *licenses.licx* and confirm with *Add*.
4. Open the newly added file and add the following content:
    
    ```
    TXTextControl.ServerTextControl, TXTextControl.Server, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638
    ```
    
    Set the *Build Action* property to *Embedded Resource*.
5. Add the following code to the *Main* method of the *Program* class to create a PDF with form fields programmatically from scratch:
    
    ```
    using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
      tx.Create();
    
      tx.Selection.FontSize = 800;
      tx.Selection.Text = "Sample Form\r\n\r\n";
    
      tx.Selection.FontSize = 400;
      tx.Selection.Text = "Company name:\r\n";
    
      // add a text form field
      TXTextControl.TextFormField textFormField = new TXTextControl.TextFormField(1000);
      textFormField.Name = "company_name";
      textFormField.Text = "Text Control, LLC";
      tx.FormFields.Add(textFormField);
    
      tx.Selection.Text = "\r\n\r\nCountry:\r\n";
    
      // add a text form field
      TXTextControl.SelectionFormField selectionFormField = new TXTextControl.SelectionFormField(1000);
      selectionFormField.Name = "company_country";
      selectionFormField.Items = new string[] { "United States", "Germany", "Italy" };
      selectionFormField.SelectedIndex = 0;
      tx.FormFields.Add(selectionFormField);
    
      // export the document as PDF
      tx.Save("results.pdf", TXTextControl.StreamType.AdobePDF);
    }
    ```

After loading this document in Adobe Acrobat Reader, the document is recognized automatically as a form and users can complete the fields.

![Creating forms](https://s1-www.textcontrol.com/assets/dist/blog/2021/02/10/a/assets/results.webp "Creating forms")

### Creating Forms Visually

An easier way to create those documents is the usage of templates. Using the fully-featured UI of all TX Text Control platform products including ASP.NET (Core), Angular, Windows Forms and WPF, the documents can be visually created including the required form fields:

![Creating forms](https://s1-www.textcontrol.com/assets/dist/blog/2021/02/10/a/assets/step3.webp "Creating forms")

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Creation of Custom Electronic Signature Boxes](https://www.textcontrol.com/blog/2021/06/15/creation-of-custom-electronic-signature-boxes/llms.txt)
- [Don't Print Your Documents! Streamlined Document Processes in Your Applications](https://www.textcontrol.com/blog/2021/06/09/dont-print-your-documents/llms.txt)
- [Importing Form Data from PDF Documents Exported from Chrome](https://www.textcontrol.com/blog/2021/02/11/importing-form-data-from-pdf-documents-exported-from-chrome/llms.txt)
- [Extending DS Server with Custom Digital Signature APIs](https://www.textcontrol.com/blog/2025/10/09/extending-ds-server-with-custom-digital-signature-apis/llms.txt)
- [Creating Advanced Tables in PDF and DOCX Documents with C#](https://www.textcontrol.com/blog/2024/09/30/creating-advanced-tables-in-pdf-and-docx-documents-with-csharp/llms.txt)
- [Form Field Compatibility: Work with AcroForms, Legacy MS Word Forms, and Content Controls](https://www.textcontrol.com/blog/2024/04/04/form-fields-working-with-acroforms-legacy-ms-word-forms-and-content-controls/llms.txt)
- [Customizing Electronic Signature Fonts for Typed Signatures in Angular and ASP.NET Core](https://www.textcontrol.com/blog/2024/03/11/customizing-electronic-signature-fonts-for-typed-signatures-in-angular-and-asp-net-core/llms.txt)
- [How to Load and View PDF Documents in ASP.NET Core C#](https://www.textcontrol.com/blog/2023/10/20/how-to-load-and-view-pdf-documents-in-aspnet-core-csharp/llms.txt)
- [How to Create and Deploy PDF Forms in ASP.NET Core C#](https://www.textcontrol.com/blog/2023/10/17/how-to-create-and-deploy-pdf-forms-in-aspnet-core-csharp/llms.txt)
- [Impressions from Web Developer Conference WDC 2023 in Hamburg, Germany](https://www.textcontrol.com/blog/2023/09/21/impressions-from-web-developer-conference-wdc-2023-in-hamburg-germany/llms.txt)
- [How to Choose the Best C# Library for your Document Processing Needs](https://www.textcontrol.com/blog/2023/08/07/how-to-choose-the-best-library-for-your-document-processing-needs/llms.txt)
- [Healthcare Use Case: Digital Forms Workflow with Electronic Signatures](https://www.textcontrol.com/blog/2023/03/15/healthcare-use-case-digital-forms-workflow-with-electronic-signatures/llms.txt)
- [Auto-Generate HTML Forms from PDF AcroForms in C#](https://www.textcontrol.com/blog/2023/03/06/autogenerate-html-forms-from-pdf-acroforms-in-csharp/llms.txt)
- [Impressions from NDC London 2023](https://www.textcontrol.com/blog/2023/01/30/impressions-from-ndc-london-2023/llms.txt)
- [See Text Control at DEVintersection Fall 2022 in Las Vegas](https://www.textcontrol.com/blog/2022/11/15/see-text-control-at-devintersection-fall-2022-in-las-vegas/llms.txt)
- [Impressions from NDC Oslo 2022](https://www.textcontrol.com/blog/2022/10/04/impressions-from-ndc-oslo-2022/llms.txt)
- [JavaScript: Avoid Flickering and Visual Updates by Grouping Undo Steps](https://www.textcontrol.com/blog/2022/07/25/javascript-avoid-flickering-and-visual-updates-by-grouping-undo-steps/llms.txt)
- [Reusing TXTextControl Instances in Bootstrap Tabs](https://www.textcontrol.com/blog/2022/06/07/reusing-txtextcontrol-instances-in-bootstrap-tabs/llms.txt)
- [Adding Attachments to Adobe PDF Documents using C#](https://www.textcontrol.com/blog/2022/02/25/adding-attachments-to-adobe-pdf-documents-using-csharp/llms.txt)
- [Document Viewer: Uploading Signatures](https://www.textcontrol.com/blog/2022/02/24/document-viewer-uploading-signatures/llms.txt)
- [Impressions from BASTA! Spring 2022](https://www.textcontrol.com/blog/2022/02/24/impressions-from-basta-spring-2022/llms.txt)
- [See Text Control at DEVintersection in Las Vegas](https://www.textcontrol.com/blog/2022/02/23/see-text-control-at-devintersection-in-las-vegas/llms.txt)
- [Version 30.0 Live Preview](https://www.textcontrol.com/blog/2021/09/22/version-30-live-preview/llms.txt)
- [TX Text Control 30.0 Preview: Improved Online Document Editor Ribbon Design](https://www.textcontrol.com/blog/2021/09/17/tx-text-control-30-preview-improved-online-document-editor-ribbon-design/llms.txt)
- [DocumentViewer: Deploying Forms](https://www.textcontrol.com/blog/2021/07/02/document-viewer-deploying-forms/llms.txt)
