IRONSOFTWAREHOME

How to Create PDF Forms in C#

Curtis Chau
Curtis Chau
Updated: August 2, 2026

Create interactive PDF forms in C# using IronPDF's comprehensive API that supports text inputs, checkboxes, radio buttons, comboboxes, image forms, and digital signatures with just a few lines of code.

Quickstart: Build Your First PDF Form with IronPDF

Get started fast with IronPDF to create interactive, fillable PDF forms. This guide shows you how to dynamically generate a PDF with form fields using simple C# code. By leveraging IronPDF's robust API, you can create text inputs, checkboxes, and more to enhance user interaction with minimal effort. Follow along to see how easy it is to define form elements and save your document.

  1. 1Install IronPDF with NuGet Package Manager

    PM > Install-Package IronPdf

  2. 2Copy and run this code snippet.

    new IronPdf.ChromePdfRenderer { RenderingOptions = { CreatePdfFormsFromHtml = true } }
        .RenderHtmlAsPdf("<html><body><form>First name: <input type='text' name='firstname' value=''>Last name: <input type='text' name='lastname' value=''></form></body></html>")
        .SaveAs("editableForm.pdf");
    C#
  3. 3Deploy to test on your live environment

    Start using IronPDF in your project today with a free trial
    arrow pointer

How Do I Create PDF Forms with IronPDF?

IronPDF creates PDF documents with embedded form fields of various types. By adding dynamic form elements to static PDF documents, you enhance flexibility and interactivity. The library supports all form elements needed for modern PDF applications, from simple text inputs to complex signature fields. Before creating forms, ensure you've installed IronPDF and configured your development environment.

How Can I Add Text Areas and Input Forms?

How Do I Render Forms From HTML?

Create text area and input forms to capture user input within PDF documents. Text areas provide space for larger text amounts, while input forms allow specific value entries. IronPDF's HTML to PDF conversion engine supports HTML form elements, simplifying complex form creation.

using IronPdf;

// Input and Text Area forms HTML
string FormHtml = @"
<html>
    <body>
        <h2>Editable PDF Form</h2>
        <form>
            First name: <br> <input type='text' name='firstname' value=''> <br>
            Last name: <br> <input type='text' name='lastname' value=''> <br>
            Address: <br> <textarea name='address' rows='4' cols='50'></textarea>
        </form>
    </body>
</html>
";

// Instantiate Renderer
ChromePdfRenderer Renderer = new ChromePdfRenderer();
Renderer.RenderingOptions.CreatePdfFormsFromHtml = true;

Renderer.RenderHtmlAsPdf(FormHtml).SaveAs("textAreaAndInputForm.pdf");

Output PDF Document

How Do I Add Text Forms Programmatically?

Add text form fields through code without HTML. First, instantiate a TextFormField object with required parameters. Then use the Add() method of the Form property to add the form. This approach works well when you need to edit existing PDFs or add forms to documents not created with HTML.

using IronPdf;
using IronSoftware.Forms;

// Instantiate ChromePdfRenderer
ChromePdfRenderer renderer = new ChromePdfRenderer();

PdfDocument pdf = renderer.RenderHtmlAsPdf("<h2>Editable PDF Form</h2>");

// Configure required parameters
string name = "firstname";
string value = "first name";
uint pageIndex = 0;
double x = 100;
double y = 700;
double width = 50;
double height = 15;

// Create text form field
var textForm = new TextFormField(name, value, pageIndex, x, y, width, height);

// Add form
pdf.Form.Add(textForm);

pdf.SaveAs("addTextForm.pdf");

Output PDF Document

Add labels to form fields by drawing text with the DrawText method. Learn more about How to Draw Text and Bitmap on PDFs. Explore custom fonts to enhance form appearance.


How Do I Create Checkbox and Combobox Forms?

How Do I Render Checkboxes and Comboboxes From HTML?

Create checkbox and combobox forms by rendering HTML strings, files, or web URLs containing these elements. Set the RenderingOptions.CreatePdfFormsFromHtml property to true to enable form creation from HTML. For complex scenarios, convert ASPX pages containing server-side form controls.

Combobox forms provide dropdown selections. Users choose from available options, providing input within PDF documents.

using IronPdf;

// Input and Text Area forms HTML
string FormHtml = @"
<html>
    <body>
        <h2>Editable PDF Form</h2>
        <h2>Task Completed</h2>
        <label>
            <input type='checkbox' id='taskCompleted' name='taskCompleted'> Mark task as completed
        </label>

        <h2>Select Priority</h2>
        <label for='priority'>Choose priority level:</label>
        <select id='priority' name='priority'>
            <option value='high'>High</option>
            <option value='medium'>Medium</option>
            <option value='low'>Low</option>
        </select>
    </body>
</html>
";

// Instantiate Renderer
ChromePdfRenderer Renderer = new ChromePdfRenderer();
Renderer.RenderingOptions.CreatePdfFormsFromHtml = true;

Renderer.RenderHtmlAsPdf(FormHtml).SaveAs("checkboxAndComboboxForm.pdf");

Output PDF Document

How Do I Add Checkboxes and Comboboxes Programmatically?

How Do I Create a Checkbox Form Field?

To add checkboxes, instantiate a CheckboxFormField object with required parameters. The value parameter determines check state: "no" for unchecked, "yes" for checked. Use the Add() method of the Form property to add the form.

using IronPdf;
using IronSoftware.Forms;

// Instantiate ChromePdfRenderer
ChromePdfRenderer renderer = new ChromePdfRenderer();

PdfDocument pdf = renderer.RenderHtmlAsPdf("<h2>Checkbox Form Field</h2>");

// Configure required parameters
string name = "checkbox";
string value = "no";
uint pageIndex = 0;
double x = 100;
double y = 700;
double width = 15;
double height = 15;

// Create checkbox form field
var checkboxForm = new CheckboxFormField(name, value, pageIndex, x, y, width, height);

// Add form
pdf.Form.Add(checkboxForm);

pdf.SaveAs("addCheckboxForm.pdf");

Output PDF Document

How Do I Create a Combobox Form Field?

To add comboboxes, instantiate a ComboboxFormField object with required parameters. The value parameter determines the selected choice. Use the Add() method of the Form property to add the form. When working with form data, extract text and images from existing PDFs to populate comboboxes dynamically.

using IronPdf;
using IronSoftware.Forms;
using System.Collections.Generic;

// Instantiate ChromePdfRenderer
ChromePdfRenderer renderer = new ChromePdfRenderer();

PdfDocument pdf = renderer.RenderHtmlAsPdf("<h2>Combobox Form Field</h2>");

// Configure required parameters
string name = "combobox";
string value = "Car";
uint pageIndex = 0;
double x = 100;
double y = 700;
double width = 60;
double height = 15;
var choices = new List<string>() { "Car", "Bike", "Airplane" };

// Create combobox form field
var comboboxForm = new ComboboxFormField(name, value, pageIndex, x, y, width, height, choices);

// Add form
pdf.Form.Add(comboboxForm);

pdf.SaveAs("addComboboxForm.pdf");

Output PDF Document


My favorite library of this kind is IronPDF. It allows for fast and efficient manipulation of PDF files. It also has many valuable features, like exporting to PDF/A format and digitally signing PDF documents.

Milan Jovanovic

Microsoft MVP

View case study

IronOCR means we can save $40,000 annually from manual processing, while enhancing productivity and freeing up resources for high-impact tasks. I would highly recommend it.

Brent Matzelle

Chief Technology Officer, OPYN

View case study

The IronSuite play a crucial role in our operations. These are tools that increase efficiencies across the business including creating floor plans and improving inventory management.

David Jones

Lead Software Engineer, Agorus Build

View case study

How Do I Create Radio Button Forms?

How Do I Render Radio Buttons From HTML?

Radio buttons in the same group are contained within one form object. Retrieve the field using the FindFormField() method with its name. The Value property contains the selected choice value, or 'None' if unselected. This mirrors HTML radio button behavior.

using IronPdf;

// Radio buttons HTML
string FormHtml = @"
<html>
    <body>
        <h2>Editable PDF Form</h2>
        Choose your preferred travel type: <br>
        <input type='radio' name='traveltype' value='Bike'>
        Bike <br>
        <input type='radio' name='traveltype' value='Car'>
        Car <br>
        <input type='radio' name='traveltype' value='Airplane'>
        Airplane
    </body>
</html>
";

// Instantiate Renderer
ChromePdfRenderer Renderer = new ChromePdfRenderer();
Renderer.RenderingOptions.CreatePdfFormsFromHtml = true;

Renderer.RenderHtmlAsPdf(FormHtml).SaveAs("radioButtomForm.pdf");

Output PDF Document

How Do I Add Radio Forms Programmatically?

Add radio button form fields through code. Instantiate a RadioFormField object with required parameters. Use the Add() method of the Form property to add the form. This approach helps when merging PDFs and adding consistent form fields across documents.

using IronPdf;
using IronSoftware.Forms;

// Instantiate ChromePdfRenderer
ChromePdfRenderer renderer = new ChromePdfRenderer();

PdfDocument pdf = renderer.RenderHtmlAsPdf("<h2>Editable PDF Form</h2>");

// Configure required parameters
string name = "choice";
string value = "yes";
uint pageIndex = 0;
double x = 100;
double y = 700;
double width = 15;
double height = 15;

// Create the first radio form
var yesRadioform = new RadioFormField(name, value, pageIndex, x, y, width, height);

value = "no";
x = 200;

// Create the second radio form
var noRadioform = new RadioFormField(name, value, pageIndex, x, y, width, height);

pdf.Form.Add(yesRadioform);
pdf.Form.Add(noRadioform);

pdf.SaveAs("addRadioForm.pdf");

Output PDF Document

Use the DrawText method to add labels for radio buttons. Learn more about How to Draw Text and Bitmap on PDFs.


How Do I Add Image Forms to PDFs?

Add image form fields through code only. Instantiate an ImageFormField object with required parameters. Use the Add() method of the Form property to add the form. Image forms work well for photo identification or signature capture functionality.

using IronPdf;
using IronSoftware.Forms;

// Instantiate ChromePdfRenderer
ChromePdfRenderer renderer = new ChromePdfRenderer();

PdfDocument pdf = renderer.RenderHtmlAsPdf("<h2>Editable PDF Form</h2>");

// Configure required parameters
string name = "image1";
uint pageIndex = 0;
double x = 100;
double y = 600;
double width = 200;
double height = 200;

// Create the image form
ImageFormField imageForm = new ImageFormField(name, pageIndex, x, y, width, height);

pdf.Form.Add(imageForm);

pdf.SaveAs("addImageForm.pdf");

Output PDF Document

Output PDF file: View Image Form PDF. Browsers do not support image forms; open in Adobe Acrobat to test this feature.

PDF form editor showing Select Image dialog with file browser, preview area, and OK/Cancel buttons

How Do I Create Unsigned Signature Forms?

Insert an unsigned or empty signature field by creating a signature object. Create a SignatureFormField object and add it using the Add() method of the Form property. Export the PDF with the empty signature field. This enables digital signatures that can be filled later with actual signature data.

using IronPdf;
using IronSoftware.Forms;

ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>testing</h1>");

// Configure required parameters
string name = "cert";
uint pageIndex = 0;
double x = 100;
double y = 600;
double width = 300;
double height = 100;

// Create signature
SignatureFormField signature = new SignatureFormField(name, pageIndex, x, y, width, height);

// Add signature
pdf.Form.Add(signature);

pdf.SaveAs("signature.pdf");

Output PDF Document

Output PDF file: signature.pdf. Browsers do not support signature forms; open in Adobe Acrobat to test this feature. For enhanced security, explore signing PDFs with HSM.

Adobe Acrobat showing unsigned signature field in PDF document with editing tools sidebar

TextFormField Add Form DrawText CreatePdfFormsFromHtml CheckboxFormField Add Form ComboboxFormField Add Form FindFormField Value RadioFormField Add Form DrawText ImageFormField Add Form Form Add

Learn to fill and edit PDF forms programmatically: "How to Fill and Edit PDF Forms". For comprehensive form security, see our guide on PDF permissions and passwords.

Ready to explore more? Check our tutorial: Sign and Secure PDFs

Frequently Asked Questions

How can I create fillable PDF forms in C# using IronPDF?

You can create fillable PDF forms in C# using IronPDF's API, which allows you to add text inputs, checkboxes, radio buttons, comboboxes, image forms, and digital signatures to your PDFs. By providing an HTML form and setting the `RenderingOptions.CreatePdfFormsFromHtml` option to true, you can generate interactive forms quickly.

What types of form fields can I add to PDFs with IronPDF?

IronPDF supports various form fields, including text inputs, checkboxes, radio buttons, comboboxes, image forms, and signature fields. These elements enhance the interactivity and user input capabilities of PDF documents.

Can I design PDF forms programmatically without HTML using IronPDF?

Yes, IronPDF allows you to design PDF forms programmatically by instantiating form field objects like `TextFormField`, `CheckboxFormField`, and `RadioFormField` and adding them to a PDF using the `Add()` method of the `Form` property.

How do I convert HTML with form fields into a fillable PDF using IronPDF?

To convert HTML with form fields into a fillable PDF, use IronPDF’s `RenderHtmlAsPdf` method. Ensure that the `RenderingOptions.CreatePdfFormsFromHtml` is set to true to enable form creation from HTML content.

How can I add a digital signature field to my PDF form using IronPDF?

You can add a digital signature field to your PDF by creating a `SignatureFormField` object and adding it to the document using the `Add()` method. The resulting PDF can be signed later with actual signature data.

Is it possible to integrate images as form fields in PDFs with IronPDF?

Yes, IronPDF allows you to integrate images as form fields by using the `ImageFormField` object. This feature is useful for photo identification or signature captures.

How do I manage checkbox and combobox forms in PDFs with IronPDF?

Checkbox and combobox forms can be created from HTML or programmatically using IronPDF. For checkboxes, instantiate a `CheckboxFormField`, and for comboboxes, use the `ComboboxFormField` object, then add these forms using the `Add()` method.

What options does IronPDF offer for enhancing the security and compliance of PDF forms?

IronPDF supports features such as digital signing, redaction, encryption, and protection to enhance the security and compliance of PDF forms, reducing yearly costs associated with PDF handling.

Can I dynamically populate form fields like comboboxes in PDFs with IronPDF?

Yes, IronPDF allows you to dynamically populate form fields such as comboboxes by using methods to extract data and set `ComboboxFormField` choices programmatically or through HTML rendering.

How can I ensure compatibility of interactive PDF forms across different PDF readers?

When using IronPDF to create interactive forms, it's advised to test features like signature and image fields in Adobe Acrobat, as some browsers may not support all interactive elements. IronPDF's comprehensive features ensure broad compatibility.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 20,756,830Version:2026.8just released

Get your FREE

30-day Trial Key instantly.

bullet_checkedNo credit card or account creation required
bullet_testTest in production
without watermarks
bullet_calendar30 days fully
functional product
bullet_support24/5 technical
support during trial
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.8

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.8

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required