Class ButtonAppearance
Appearance model for button fields (spec §12.7.4.4). Supports per-trigger caption text (label) and icon (form XObject) so that a push button or toggle button can display different content for the normal, rollover, and down states. The caption text entries map to the appearance-characteristics dictionary (/MK): /CA (normal), /RC (rollover), /AC (alternate/down).
Inherited Members
Namespace: DRIT.Pdf.Forms
Assembly: DRIT.Pdf.dll
Syntax
public sealed class ButtonAppearance
Properties
BackgroundColor
The background colour of the button (spec §12.7.4.4, /MK /BC).
Declaration
public PdfColor? BackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| PdfColor? |
BorderColor
The border colour of the button (spec §12.7.4.4, /MK /BS is border style; colour via /BC).
Declaration
public PdfColor? BorderColor { get; set; }
Property Value
| Type | Description |
|---|---|
| PdfColor? |
Label
The normal-state caption text (spec §12.7.4.4, /MK /CA). When non-null this is written as the button label.
Declaration
public string? Label { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetIcon(ButtonAppearanceTrigger)
Gets the resource name of the icon form XObject for the specified trigger.
Returns null when no icon is set for that trigger.
Declaration
public string? GetIcon(ButtonAppearanceTrigger trigger)
Parameters
| Type | Name | Description |
|---|---|---|
| ButtonAppearanceTrigger | trigger | The appearance trigger. |
Returns
| Type | Description |
|---|---|
| string |
GetLabel(ButtonAppearanceTrigger)
Gets the caption text for the specified trigger.
Declaration
public string? GetLabel(ButtonAppearanceTrigger trigger)
Parameters
| Type | Name | Description |
|---|---|---|
| ButtonAppearanceTrigger | trigger | The appearance trigger. |
Returns
| Type | Description |
|---|---|
| string | The caption text, or |
SetIcon(ButtonAppearanceTrigger, string?)
Sets the resource name of the icon form XObject for the specified trigger.
Declaration
public void SetIcon(ButtonAppearanceTrigger trigger, string? iconName)
Parameters
| Type | Name | Description |
|---|---|---|
| ButtonAppearanceTrigger | trigger | The appearance trigger. |
| string | iconName | The resource name, or |
SetLabel(ButtonAppearanceTrigger, string?)
Sets the caption text for the specified trigger.
Declaration
public void SetLabel(ButtonAppearanceTrigger trigger, string? label)
Parameters
| Type | Name | Description |
|---|---|---|
| ButtonAppearanceTrigger | trigger | The appearance trigger. |
| string | label | The caption text, or |