Skip to main content
All docs
V24.1

PdfButtonWidgetIconOptions Class

Contains properties that define how to display the button’s icon in the widget annotation.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

Declaration

public class PdfButtonWidgetIconOptions

The following members return PdfButtonWidgetIconOptions objects:

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 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;
}

Inheritance

Object
PdfButtonWidgetIconOptions
See Also