PdfButtonAppearance Class
Represents an appearance settings for a PdfButtonField.
public sealed class PdfButtonAppearance : PdfFieldAppearance
Public NotInheritable Class PdfButtonAppearance
Inherits PdfFieldAppearance
- Inheritance:
- System.ObjectPdfButtonAppearance
Properties
BackgroundColor
Gets or sets the background color of the button appearance.
Property Value
- System.Nullable<PdfColor>
The background color of the button appearance.
Exceptions
- System.ArgumentException
The value's Space is not device color space (DeviceGray, DeviceRGB, or DeviceCMYK).
See Also
BorderColor
Gets or sets the border color of the button appearance.
Property Value
- System.Nullable<PdfColor>
The border color of the button appearance.
Exceptions
- System.ArgumentException
The value's Space is not device color space (DeviceGray, DeviceRGB, or DeviceCMYK).
See Also
BorderDashPattern
Gets or sets the border dash pattern of the button appearance.
public PdfLineDashPattern BorderDashPattern { get; set; }
Public Property BorderDashPattern As PdfLineDashPattern
Property Value
The border dash pattern of the button appearance.
See Also
BorderStyle
Gets or sets the border style of the button appearance.
public PdfBorderStyle BorderStyle { get; set; }
Public Property BorderStyle As PdfBorderStyle
Property Value
The border style of the button appearance.
Exceptions
- System.NotSupportedException
Value Unknown of enumeration PdfBorderStyle is not supported in the requested operation.
See Also
BorderWidth
Gets or sets the border thickness of the button appearance.
Property Value
- System.Double
The border thickness of the button appearance.
Exceptions
- System.ArgumentOutOfRangeException
Value is less than 0.
- System.ArgumentException
Value is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
See Also
FontColor
Gets or sets the font color of the button appearance text.
Property Value
The font color of the button appearance text.
See Also
FontFace
Gets or sets the font face of the button appearance text.
Property Value
The font face of the button appearance text.
Exceptions
- System.ArgumentNullException
Value is null.
See Also
FontSize
Gets or sets the font size of the button appearance text.
A zero value for size means that the font shall be auto-sized: its size shall be computed as a function of the size of the annotation rectangle.
Property Value
- System.Double
The font size of the button appearance text.
Exceptions
- System.ArgumentException
Value is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
- System.ArgumentOutOfRangeException
Value is less than 0.
See Also
Icon
Gets or sets the icon.
Property Value
The icon.
See Also
IconAlignment
Gets or sets the two numbers that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the left and bottom of the Icon.
A value of (0.0, 0.0) shall position the icon at the bottom-left corner of the annotation rectangle.
A value of (0.5, 0.5) shall center it within the rectangle.
This entry shall be used only if the icon is scaled proportionally.
Property Value
The two numbers that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the left and bottom of the Icon.
Exceptions
See Also
IconFitToBounds
(Optional; PDF 1.5) If true, indicates that the button appearance shall be scaled to fit fully within the bounds of the annotation without taking into consideration the line width of the border.
Property Value
- System.Boolean
If true, indicates that the button appearance shall be scaled to fit fully within the bounds of the annotation without taking into consideration the line width of the border.
See Also
IconScaleCondition
Gets or sets the condition under which the Icon shall be scaled inside the annotation rectangle.
public PdfScaleCondition IconScaleCondition { get; set; }
Public Property IconScaleCondition As PdfScaleCondition
Property Value
The condition under which the Icon shall be scaled inside the annotation rectangle.
See Also
IconScaleProportional
Gets or sets a value indicating whether to scale the Icon to fit the width or height of the annotation rectangle while maintaining the icon's original aspect ratio.
If the required horizontal and vertical scaling factors are different, the smaller of the two is used, centering the icon within the annotation rectangle in the other dimension.
If false, the Icon is scaled to fill the annotation rectangle exactly, without regard to its original aspect ratio (ratio of width to height).
public bool IconScaleProportional { get; set; }
Public Property IconScaleProportional As Boolean
Property Value
- System.Boolean
true to scale the Icon to fit the width or height of the annotation rectangle while maintaining the icon's original aspect ratio.; otherwise, false.
See Also
Label
Gets or sets the label.
Property Value
- System.String
The label.
See Also
LabelPlacement
public PdfTextPlacement LabelPlacement { get; set; }
Public Property LabelPlacement As PdfTextPlacement
Property Value
See Also
Methods
GetIcon(PdfAppearanceTrigger)
Gets the icon for the specified appearance trigger.
public PdfForm GetIcon(PdfAppearanceTrigger trigger)
Public Function GetIcon(trigger As PdfAppearanceTrigger) As PdfForm
Parameters
trigger
- PdfAppearanceTrigger
The appearance trigger for which to get an icon.
Returns
An icon for the specified appearance trigger.
See Also
GetLabel(PdfAppearanceTrigger)
Gets the label for the specified appearance trigger.
public string GetLabel(PdfAppearanceTrigger trigger)
Public Function GetLabel(trigger As PdfAppearanceTrigger) As String
Parameters
trigger
- PdfAppearanceTrigger
The appearance trigger for which to get a label.
Returns
- System.String
A label for the specified appearance trigger.
See Also
SetIcon(PdfAppearanceTrigger, PdfForm)
Sets the icon for the specified appearance trigger.
public void SetIcon(PdfAppearanceTrigger trigger, PdfForm value)
Public Sub SetIcon(trigger As PdfAppearanceTrigger, value As PdfForm)
Parameters
trigger
- PdfAppearanceTrigger
The appearance trigger for which to set the icon.
value
- PdfForm
The icon to set for the specified appearance trigger.
See Also
SetIcon(PdfImage, PdfAppearanceTrigger)
Sets the icon from the specified PdfImage.
PdfButtonField icons are PdfForm instances. This method creates, sets, and returns a PdfForm icon that draws the specified input PdfImage.
This method is useful for setting an image to an PdfButtonField. For more information about Image fields, see remarks of the method AddImage(PdfPage, Double, Double, Double, Double).
public PdfForm SetIcon(PdfImage value, PdfAppearanceTrigger trigger = PdfAppearanceTrigger.Normal)
Public Function SetIcon(value As PdfImage, trigger As PdfAppearanceTrigger = PdfAppearanceTrigger.Normal) As PdfForm
Parameters
trigger
- PdfAppearanceTrigger
The optional appearance trigger for which to set the icon.
Returns
Exceptions
- System.ArgumentNullException
value
is null.
See Also
SetLabel(PdfAppearanceTrigger, String)
Sets the label for the specified appearance trigger.
public void SetLabel(PdfAppearanceTrigger trigger, string value)
Public Sub SetLabel(trigger As PdfAppearanceTrigger, value As String)
Parameters
trigger
- PdfAppearanceTrigger
The appearance trigger for which to set the label.
value
- System.String
The label to set for the specified appearance trigger.
See Also
Inherited Properties
Orientation | (Optional) The number of degrees by which the widget annotation shall be rotated counterclockwise relative to the page. The value shall be a multiple of 90. Default value: 0. (Inherited from PdfFieldAppearance) |
State | (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, "Appearance Streams"). (Inherited from PdfAppearance) |
Inherited Methods
BeginInit() | Begins initialization of the PdfAppearance. Call EndInit() to end the initialization and update the appearance. If BeginInit() is called on a PdfAppearance that is already being initialized, the second and subsequent calls are ignored. (Inherited from PdfAppearance) |
EndInit() | Ends initialization of the PdfAppearance by updating the changed appearance. This method will be ignored if called on a PdfAppearance that is not being initialized. (Inherited from PdfAppearance) |
Get() | Gets the appearance form for the Normal appearance trigger and the current appearance State. (Inherited from PdfAppearance) |
Get(PdfAppearanceTrigger) | Gets a collection of appearance states and the associated appearance forms for the specified appearance trigger. (Inherited from PdfAppearance) |
Get(PdfAppearanceTrigger, PdfAppearanceState) | Gets the appearance form for the specified appearance trigger and appearance state. (Inherited from PdfAppearance) |
Refresh() | Forces an update of the appearance. (Inherited from PdfAppearance) |
Set(PdfAppearanceTrigger, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<PdfAppearanceState, PdfForm>>) | Sets a collection of appearance states and the associated appearance forms for the specified appearance trigger. (Inherited from PdfAppearance) |
Set(PdfAppearanceTrigger, PdfAppearanceState, PdfForm) | Sets the appearance form for the specified appearance trigger and appearance state. (Inherited from PdfAppearance) |
Set(PdfForm) | Sets the appearance form for the Normal appearance trigger and the current appearance State. (Inherited from PdfAppearance) |