Skip to main content
All docs
V23.2

PdfButtonWidgetFacade.IconOptions Property

Retrieves the button widget’s icon options.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

Declaration

public PdfButtonWidgetIconOptions IconOptions { get; }

Property Value

Type Description
PdfButtonWidgetIconOptions

The object that contains button icon options.

Remarks

Use the following methods to specify a button icon:

  • SetNormalIcon – Specifies the button icon displayed when the button is not clicked.
  • SetAlternateIcon – Specifies the button icon displayed when the user clicks the button, but before the button is released.
  • SetRolloverIcon – Specifies the button icon displayed when the mouse pointer hovers over the button.

The code sample below specifies a normal icon and its scale options:

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

    PdfDocumentFacade documentFacade = pdfDocumentProcessor.DocumentFacade;
    PdfAcroFormFacade acroForm = documentFacade.AcroForm;

    //Change all form fields' color settings:
    var fields = acroForm.GetFields();
    foreach (PdfFormFieldFacade field in fields)
    {
        ChangeFormFieldColor(field);
    }

    //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;
}
See Also