How to Fill and Edit PDF Forms

This article was translated from English: Does it need improvement?
Translated
View the article in English

IronPDF offers an intuitive toolset to edit existing forms in a PDF document, including text areas, text inputs, checkboxes, combo boxes, and radio buttons.

Quickstart: Filling PDF Forms with IronPDF

Easily fill and edit PDF forms with IronPDF in just a few steps. This quick guide demonstrates how to locate form fields, modify their values, and save the updated document. Perfect for developers looking to seamlessly integrate PDF form editing into their C# applications.

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronPDF with NuGet Package Manager

    PM > Install-Package IronPdf

  2. Copy and run this code snippet.

    var pdf = IronPdf.PdfDocument.FromFile("form.pdf");
    var field = pdf.Form.FindFormField("nameField");
    field.Value = "John Doe";
    pdf.SaveAs("updated_form.pdf");
  3. Deploy to test on your live environment

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

Edit Forms

IronPDF effortlessly edits existing form fields of various types in a PDF document.

Text Area and Input Forms

To edit text areas and input forms, assign the Value property to the desired information. The code below first finds the form object using the FindFormField method with the form name. Then, it accesses and assigns the Value property of the object.

:path=/static-assets/pdf/content-code-examples/how-to/edit-forms-input-textarea.cs
using IronPdf;

PdfDocument pdf = PdfDocument.FromFile("textAreaAndInputForm.pdf");

// Set text input form values
pdf.Form.FindFormField("firstname").Value = "John";
pdf.Form.FindFormField("lastname").Value = "Smith";

// Set text area form values
pdf.Form.FindFormField("address").Value = "Iron Software LLC\r\n205 N. Michigan Ave.";

pdf.SaveAs("textAreaAndInputFormEdited.pdf");
Imports Microsoft.VisualBasic
Imports IronPdf

Private pdf As PdfDocument = PdfDocument.FromFile("textAreaAndInputForm.pdf")

' Set text input form values
pdf.Form.FindFormField("firstname").Value = "John"
pdf.Form.FindFormField("lastname").Value = "Smith"

' Set text area form values
pdf.Form.FindFormField("address").Value = "Iron Software LLC" & vbCrLf & "205 N. Michigan Ave."

pdf.SaveAs("textAreaAndInputFormEdited.pdf")
$vbLabelText   $csharpLabel

Output PDF document


Checkbox and Combobox Forms

Edit existing checkbox and combobox forms by first finding the form field by its name. Assign the Value property to 'Yes' to check the checkbox form. Select any available choice in the combobox by assigning the desired choice to its Value property. For convenience, retrieve all the choices' values by accessing the Choices property.

:path=/static-assets/pdf/content-code-examples/how-to/edit-forms-checkbox-combobox.cs
using IronPdf;
using System;

PdfDocument pdf = PdfDocument.FromFile("checkboxAndComboboxForm.pdf");

var checkboxForm = pdf.Form.FindFormField("taskCompleted");
// Check the checkbox form
checkboxForm.Value = "Yes";

var comboboxForm = pdf.Form.FindFormField("priority");
// Set the combobox value
comboboxForm.Value = "Low";

// Print out all the available choices
foreach (var choice in comboboxForm.Choices)
{
    Console.WriteLine(choice);
}
pdf.SaveAs("checkboxAndComboboxFormEdited.pdf");
Imports IronPdf
Imports System

Private pdf As PdfDocument = PdfDocument.FromFile("checkboxAndComboboxForm.pdf")

Private checkboxForm = pdf.Form.FindFormField("taskCompleted")
' Check the checkbox form
checkboxForm.Value = "Yes"

Dim comboboxForm = pdf.Form.FindFormField("priority")
' Set the combobox value
comboboxForm.Value = "Low"

' Print out all the available choices
For Each choice In comboboxForm.Choices
	Console.WriteLine(choice)
Next choice
pdf.SaveAs("checkboxAndComboboxFormEdited.pdf")
$vbLabelText   $csharpLabel

Output PDF document


Radio buttons Forms

When working with radio button forms in IronPDF, radio buttons of the same group are contained within one form object. To edit the radio button value, simply assign the Value property of the form object to one of the available choices. Retrieve all the available choices with the Annotations property. The code below demonstrates how to edit the radio button value.

:path=/static-assets/pdf/content-code-examples/how-to/edit-forms-radiobutton.cs
using IronPdf;
using System;

PdfDocument pdf = PdfDocument.FromFile("radioButtomForm.pdf");
var radioForm = pdf.Form.FindFormField("traveltype");

// Set the radio button value
radioForm.Value = "Airplane";

// Print out all the available choices
foreach(var annotation in radioForm.Annotations)
{
    Console.WriteLine(annotation.OnAppearance);
}

pdf.SaveAs("radioButtomFormEdited.pdf");
Imports IronPdf
Imports System

Private pdf As PdfDocument = PdfDocument.FromFile("radioButtomForm.pdf")
Private radioForm = pdf.Form.FindFormField("traveltype")

' Set the radio button value
radioForm.Value = "Airplane"

' Print out all the available choices
For Each annotation In radioForm.Annotations
	Console.WriteLine(annotation.OnAppearance)
Next annotation

pdf.SaveAs("radioButtomFormEdited.pdf")
$vbLabelText   $csharpLabel

Additionally, use the Clear method to deselect the radio button. This method can only be accessed when the object is of type RadioFormField. Upon accessing the radio form object from the PDF, it can be cast to the RadioFormField type.

Output PDF document


Remove Forms

To remove forms from the PDF, first select the target form using the FindFormField method. Pass the form object to the Form.Remove method, which can be accessed from the PdfDocument object.

:path=/static-assets/pdf/content-code-examples/how-to/edit-forms-remove-form.cs
using IronPdf;
using IronSoftware.Forms;

PdfDocument pdf = PdfDocument.FromFile("textAreaAndInputForm.pdf");

// Remove Form
IFormField targetForm = pdf.Form.FindFormField("firstname");
pdf.Form.Remove(targetForm);

pdf.SaveAs("removedForm.pdf");
Imports IronPdf
Imports IronSoftware.Forms

Private pdf As PdfDocument = PdfDocument.FromFile("textAreaAndInputForm.pdf")

' Remove Form
Private targetForm As IFormField = pdf.Form.FindFormField("firstname")
pdf.Form.Remove(targetForm)

pdf.SaveAs("removedForm.pdf")
$vbLabelText   $csharpLabel

Output PDF document

Learn how to create PDF forms programmatically in the following article: "How to Create PDF Forms."

Ready to see what else you can do? Check out our tutorial page here: Sign and Secure PDFs

Preguntas Frecuentes

¿Cómo puedo empezar a editar formularios PDF usando una biblioteca C#?

Para empezar a editar formularios PDF usando IronPDF, primero descarga la biblioteca C# desde NuGet. Luego, importa el documento PDF usando el método FromFile, localiza el campo de formulario usando FindFormField, y modifica la propiedad Value según sea necesario.

¿Cómo edito áreas de texto y formularios de entrada en un PDF usando una biblioteca C#?

Para editar áreas de texto y formularios de entrada, usa el método FindFormField para localizar el campo de formulario por nombre. Luego, asigna el valor deseado a la propiedad Value del objeto de campo de formulario en IronPDF.

¿Cómo puedo editar casillas de verificación y cuadros combinados en un formulario PDF con una biblioteca C#?

Para editar casillas de verificación, establece la propiedad Value en 'Yes'. Para cuadros combinados, asigna la opción deseada a la propiedad Value después de encontrar el campo con FindFormField. Puedes acceder a todos los valores de opción usando la propiedad Choices en IronPDF.

¿Cuál es el método para editar formularios de botón de opción usando una biblioteca C#?

Los botones de opción se editan asignando la opción deseada a la propiedad Value del objeto de formulario en IronPDF. Accede a todas las opciones disponibles usando la propiedad Annotations, y utiliza el método Clear para deseleccionar un botón de opción.

¿Cómo puedo eliminar formularios de un PDF usando una biblioteca C#?

Para eliminar un formulario de un PDF, usa el método FindFormField para seleccionar el campo de formulario, luego pasa el objeto de campo al método Form.Remove del objeto PdfDocument en IronPDF.

¿Puede usarse una biblioteca C# para editar campos de formulario PDF existentes de cualquier tipo?

Sí, IronPDF puede editar campos de formulario existentes como áreas de texto, entradas de texto, casillas de verificación, cuadros combinados y botones de opción en un documento PDF.

¿Es posible crear formularios PDF de manera programática usando una biblioteca C#?

Sí, puedes crear formularios PDF de manera programática usando IronPDF. Para más información, consulta el artículo '[Cómo Crear Formularios PDF](/how-to/create-forms/)'.

¿Qué características adicionales proporciona una solución de gestión de documentos?

IronSecureDoc ofrece soluciones para gestionar servicios SaaS como la firma digital, redacción, cifrado y protección, todo con un solo pago.

¿Cómo exporto un PDF editado después de modificar campos de formulario usando C#?

Después de modificar campos de formulario usando IronPDF, puedes exportar el documento PDF editado guardando los cambios de nuevo en el sistema de archivos usando el método SaveAs en el objeto PdfDocument.

¿Puedo usar C# para acceder y editar todas las opciones en un cuadro combinado PDF?

Sí, con IronPDF, puedes acceder a todas las opciones en un cuadro combinado PDF usando la propiedad Choices y editar la opción deseada estableciendo la propiedad Value.

Compatibilidad con .NET 10: ¿Puedo usar IronPDF para editar formularios PDF cuando utilizo .NET 10 como destino?

Sí, IronPDF es totalmente compatible con .NET 10, por lo que puede editar formularios PDF (incluso buscar, cambiar y eliminar campos de formulario) utilizando las mismas API (como FindFormField , Form y PdfDocument ) en un proyecto .NET 10 sin ningún cambio de código especial.

Chaknith Bin
Ingeniero de Software
Chaknith trabaja en IronXL e IronBarcode. Tiene un profundo conocimiento en C# y .NET, ayudando a mejorar el software y apoyar a los clientes. Sus conocimientos derivados de las interacciones con los usuarios contribuyen a mejores productos, documentación y experiencia en general.
¿Listo para empezar?
Nuget Descargas 16,154,058 | Versión: 2025.11 recién lanzado