Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfButtonFormField Class

A button field (a push button, radio group, check box) on a PDF interactive form that the user can manipulate with the mouse.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v24.2.Core.dll

NuGet Package: DevExpress.Pdf.Core

#Declaration

public class PdfButtonFormField :
    PdfInteractiveFormField

#Remarks

The code sample below retrieves the button form field by name and changes its properties:

using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
    pdfDocumentProcessor.LoadDocument("FormDemo.pdf");
    ChangeFormFields(pdfDocumentProcessor);
    pdfDocumentProcessor.SaveDocument("FormDemo.pdf");
    Process.Start(new ProcessStartInfo("FormDemo.pdf")
       { UseShellExecute = true });
}


  private static void ChangeFormFields(PdfDocumentProcessor pdfDocumentProcessor)
  {
      PdfInteractiveForm acroForm = pdfDocumentProcessor.Document.AcroForm;

      //Change radio group field properties:
      PdfButtonFormField genderFormField = (PdfButtonFormField)acroForm.GetFormField("Gender");
      genderFormField.ToggleToOff = true;
  }

#Inheritance

Object
DevExpress.Pdf.Native.PdfDocumentItem
DevExpress.Pdf.Native.PdfObject
PdfInteractiveFormField
PdfButtonFormField
See Also