Skip to main content
A newer version of this page is available. .
All docs
V21.2
.NET Framework 4.5.2+

PdfAcroFormFacade.GetButtonFormField(String) Method

Gets a specific button form field’s properties.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v21.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