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

PdfButtonWidgetIconOptions Class

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

Namespace: DevExpress.Pdf

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