Skip to main content
All docs
V21.2
.NET Framework 4.5.2+

PdfButtonWidgetIconOptions Class

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

Namespace: DevExpress.Pdf

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

Declaration

public class PdfButtonWidgetIconOptions

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