GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfButtonAppearance Class

    Namespace:
    GemBox.Pdf.Forms
    Assembly:
    GemBox.Pdf.dll

    Represents an appearance settings for a PdfButtonField.

    • C#
    • VB.NET
    public sealed class PdfButtonAppearance : PdfFieldAppearance
    Public NotInheritable Class PdfButtonAppearance
        Inherits PdfFieldAppearance
    Inheritance:
    System.Object
    PdfAppearance
    PdfFieldAppearance
    PdfButtonAppearance

    Properties

    BackgroundColor

    Gets or sets the background color of the button appearance.

    • C#
    • VB.NET
    public PdfColor? BackgroundColor { get; set; }
    Public Property BackgroundColor As PdfColor?
    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
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    BorderColor

    Gets or sets the border color of the button appearance.

    • C#
    • VB.NET
    public PdfColor? BorderColor { get; set; }
    Public Property BorderColor As PdfColor?
    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
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    BorderDashPattern

    Gets or sets the border dash pattern of the button appearance.

    • C#
    • VB.NET
    public PdfLineDashPattern BorderDashPattern { get; set; }
    Public Property BorderDashPattern As PdfLineDashPattern
    Property Value
    PdfLineDashPattern

    The border dash pattern of the button appearance.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.4 Border Styles'

    BorderStyle

    Gets or sets the border style of the button appearance.

    • C#
    • VB.NET
    public PdfBorderStyle BorderStyle { get; set; }
    Public Property BorderStyle As PdfBorderStyle
    Property Value
    PdfBorderStyle

    The border style of the button appearance.

    Exceptions
    System.NotSupportedException

    Value Unknown of enumeration PdfBorderStyle is not supported in the requested operation.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.4 Border Styles'

    BorderWidth

    Gets or sets the border thickness of the button appearance.

    • C#
    • VB.NET
    public double BorderWidth { get; set; }
    Public Property BorderWidth As Double
    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
    PDF Specification ISO 32000-1:2008, section '12.5.4 Border Styles'

    FontColor

    Gets or sets the font color of the button appearance text.

    • C#
    • VB.NET
    public PdfColor FontColor { get; set; }
    Public Property FontColor As PdfColor
    Property Value
    PdfColor

    The font color of the button appearance text.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.7.3.3 Variable Text'

    FontFace

    Gets or sets the font face of the button appearance text.

    • C#
    • VB.NET
    public PdfFontFace FontFace { get; set; }
    Public Property FontFace As PdfFontFace
    Property Value
    PdfFontFace

    The font face of the button appearance text.

    Exceptions
    System.ArgumentNullException

    Value is null.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.7.3.3 Variable Text'

    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.

    • C#
    • VB.NET
    public double FontSize { get; set; }
    Public Property FontSize As Double
    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
    PDF Specification ISO 32000-1:2008, section '12.7.3.3 Variable Text'

    Icon

    Gets or sets the icon.

    • C#
    • VB.NET
    public PdfForm Icon { get; set; }
    Public Property Icon As PdfForm
    Property Value
    PdfForm

    The icon.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    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.

    • C#
    • VB.NET
    public PdfPoint IconAlignment { get; set; }
    Public Property IconAlignment As PdfPoint
    Property Value
    PdfPoint

    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
    System.ArgumentOutOfRangeException

    Value's X and Y must be between 0.0 and 1.0 (inclusive).

    See Also
    PDF Specification ISO 32000-1:2008, Table 247 – Entries in an icon fit dictionary

    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.

    • C#
    • VB.NET
    public bool IconFitToBounds { get; set; }
    Public Property IconFitToBounds As Boolean
    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
    PDF Specification ISO 32000-1:2008, Table 247 – Entries in an icon fit dictionary

    IconScaleCondition

    Gets or sets the condition under which the Icon shall be scaled inside the annotation rectangle.

    • C#
    • VB.NET
    public PdfScaleCondition IconScaleCondition { get; set; }
    Public Property IconScaleCondition As PdfScaleCondition
    Property Value
    PdfScaleCondition

    The condition under which the Icon shall be scaled inside the annotation rectangle.

    See Also
    PDF Specification ISO 32000-1:2008, Table 247 – Entries in an icon fit dictionary

    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).

    • C#
    • VB.NET
    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
    PDF Specification ISO 32000-1:2008, Table 247 – Entries in an icon fit dictionary

    Label

    Gets or sets the label.

    • C#
    • VB.NET
    public string Label { get; set; }
    Public Property Label As String
    Property Value
    System.String

    The label.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    LabelPlacement

    Gets or sets the placement of the Label relative to its Icon.

    • C#
    • VB.NET
    public PdfTextPlacement LabelPlacement { get; set; }
    Public Property LabelPlacement As PdfTextPlacement
    Property Value
    PdfTextPlacement

    The placement of the Label relative to its Icon.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    Methods

    GetIcon(PdfAppearanceTrigger)

    Gets the icon for the specified appearance trigger.

    • C#
    • VB.NET
    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
    PdfForm

    An icon for the specified appearance trigger.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    GetLabel(PdfAppearanceTrigger)

    Gets the label for the specified appearance trigger.

    • C#
    • VB.NET
    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
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    SetIcon(PdfAppearanceTrigger, PdfForm)

    Sets the icon for the specified appearance trigger.

    • C#
    • VB.NET
    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
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    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).

    • C#
    • VB.NET
    public PdfForm SetIcon(PdfImage value, PdfAppearanceTrigger trigger = PdfAppearanceTrigger.Normal)
    Public Function SetIcon(value As PdfImage, trigger As PdfAppearanceTrigger = PdfAppearanceTrigger.Normal) As PdfForm
    Parameters
    value
    PdfImage

    The PdfImage from which to set the icon.

    trigger
    PdfAppearanceTrigger

    The optional appearance trigger for which to set the icon.

    Returns
    PdfForm

    The created and set PdfForm icon that draws the specified input PdfImage.

    Exceptions
    System.ArgumentNullException

    value is null.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    SetLabel(PdfAppearanceTrigger, String)

    Sets the label for the specified appearance trigger.

    • C#
    • VB.NET
    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
    PDF Specification ISO 32000-1:2008, section '12.5.6.19 Widget Annotations'

    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)

    See Also

    PDF Specification ISO 32000-1:2008, section '12.7.3.3 Variable Text'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.