officefileapi-devexpress-dot-pdf-323203e3.md
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.v25.2.Core.dll
NuGet Package : DevExpress.Pdf.Core
public class PdfButtonFormField :
PdfInteractiveFormField
Public Class PdfButtonFormField
Inherits PdfInteractiveFormField
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;
}
Using pdfDocumentProcessor As New PdfDocumentProcessor()
pdfDocumentProcessor.LoadDocument("FormDemo.pdf")
ChangeFormFields(pdfDocumentProcessor)
pdfDocumentProcessor.SaveDocument("FormDemo.pdf")
Process.Start(New ProcessStartInfo("FormDemo.pdf") With {.UseShellExecute = True})
End Using
private static void ChangeFormFields(PdfDocumentProcessor pdfDocumentProcessor)
Dim acroForm As PdfInteractiveForm = pdfDocumentProcessor.Document.AcroForm
'Change radio group field properties:
Dim genderFormField As PdfButtonFormField = CType(acroForm.GetFormField("Gender"), PdfButtonFormField)
genderFormField.ToggleToOff = True
End Sub
Object DevExpress.Pdf.Native.PdfDocumentItem DevExpress.Pdf.Native.PdfObject PdfInteractiveFormField PdfButtonFormField
See Also