Skip to main content
All docs
V24.2

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

PdfAcroFormFacade.GetButtonFormField(String) Method

Gets a specific button form field’s properties.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

#Declaration

public PdfButtonFormFieldFacade GetButtonFormField(
    string fullName
)

#Parameters

Name Type Description
fullName String

A form field name.

#Returns

Type Description
PdfButtonFormFieldFacade

An object that contains the button form field properties.

#Remarks

The PdfButtonFormFieldFacade object contains form field and widget properties without access to the form field’s inner structure. Use the Widgets property to get form field widget settings. Use the PdfButtonWidgetFacade.IconOptions property to get the button icon options.

The code sample below specifies a button form field icon and its scaling options:

using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
    pdfDocumentProcessor.LoadDocument("Documents//FormDemo.pdf");

    PdfDocumentFacade documentFacade = pdfDocumentProcessor.DocumentFacade;
    PdfAcroFormFacade acroForm = documentFacade.AcroForm;
    //Obtain button form field parameters:
    PdfButtonFormFieldFacade pushButton = acroForm.GetButtonFormField("Submit");
    PdfButtonWidgetFacade buttonWidget = pushButton.Widgets[0];

    //Specify a button icon and set its options:
    buttonWidget.SetNormalIcon("Documents//submit_3802014.png");
    buttonWidget.IconOptions.FitToAnnotationBounds = true;
    buttonWidget.IconOptions.ScaleCondition = PdfIconScalingCircumstances.BiggerThanAnnotationRectangle;
    buttonWidget.TextPosition = PdfWidgetAnnotationTextPosition.NoCaption;
    pdfDocumentProcessor.SaveDocument("FormDemo_new.pdf");
}
See Also