Back to Devexpress

How to: Obtain a Checked Appearance Name for a Check Box with DevExpress PDF Document API

officefileapi-120047-pdf-document-api-examples-interactive-form-how-to-obtain-a-checked-appearance-name-for-a-check-box.md

latest1.9 KB
Original Source

How to: Obtain a Checked Appearance Name for a Check Box with DevExpress PDF Document API

  • Sep 22, 2025

The following code snippet gets a checked appearance name for the “Female” check box and check the check box with this value.

View Example

csharp
using System.Collections.Generic;
using System.Linq;
using DevExpress.Pdf;

static void Main(string[] args)
{
    // Load a document with an interactive form.
    PdfDocumentProcessor processor = new PdfDocumentProcessor();
    processor.LoadDocument("..\\..\\InteractiveForm.pdf");

    PdfDocumentFacade documentFacade = processor.DocumentFacade;
    PdfAcroFormFacade acroForm = documentFacade.AcroForm;

    // Obtain the check box form field:
    PdfCheckBoxFormFieldFacade genderField = acroForm.GetCheckBoxFormField("Female");

    // Specify a checked value for the Female form field:
    genderField.IsChecked = true;

    // Save the modified document.
    processor.SaveDocument("..\\..\\Result.pdf");
}
vb

Shared Sub Main(ByVal args() As String) ‘ Load a document with an interactive form. Dim processor As New PdfDocumentProcessor() processor.LoadDocument(“....\InteractiveForm.pdf”)

Dim documentFacade As PdfDocumentFacade = processor.DocumentFacade Dim acroForm As PdfAcroFormFacade = documentFacade.AcroForm

' Obtain the check box form field: Dim genderField As PdfCheckBoxFormFieldFacade = acroForm.GetCheckBoxFormField("Female")

' Specify a checked value for the Female form field: genderField.IsChecked = True

' Save the modified document. processor.SaveDocument("....\Result.pdf")


End Sub