Skip to main content

How to: Obtain a Checked Appearance Name for a Check Box

This example shows how to get a checked appearance name for the “Female” check box and check the check box with this value.

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");
}