Summary: Constants | Inherited Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# Widget

extends Annot

java.lang.Object
↳ | com.pdftron.pdf.Annot
| ↳ | com.pdftron.pdf.annots.Widget

Known Direct Subclasses CheckBoxWidget, ComboBoxWidget, ListBoxWidget, PushButtonWidget, RadioButtonWidget, SignatureWidget, TextWidget
CheckBoxWidget | An object representing a check box used in a PDF Form.
ComboBoxWidget | An object representing a Combo Box used in a PDF Form.
ListBoxWidget | An object representing a List Box used in a PDF Form.
PushButtonWidget | An object representing a push button used in a PDF Form.
RadioButtonWidget | An object representing a Radio Button used in a PDF Form.
SignatureWidget | An object representing a Signature used in a PDF Form.
TextWidget | An object representing a Text Box used in a PDF Form.

## Class Overview

Interactive forms use widget annotations (PDF 1.2) to represent the appearance of fields and to manage user interactions. As a convenience, when a field has only a single associated widget annotation, the contents of the field dictionary and the annotation dictionary may be merged into a single dictionary containing entries that pertain to both a field and an annotation. NOTE This presents no ambiguity, since the contents of the two kinds of dictionaries do not conflict.

## Summary

Constants
int | e_Always | This enum represents the circumstances under which the icon shall be scaled inside the annotation rectangle .
int | e_Anamorphic | This integer list represents the scale type of the Widget annotation e_Anamorphic - Scale the icon to fill the annotation rectangle exactly, without regard to its original aspect ratio (ratio of width to height).
int | e_CAboveI | The Constant e_CAboveI.
int | e_CBelowI | The Constant e_CBelowI.
int | e_CLeftIRight | The Constant e_CLeftIRight.
int | e_COverlayI | The Constant e_COverlayI.
int | e_CRightILeft | The Constant e_CRightILeft.
int | e_Never | The Constant e_Never.
int | e_NoCaption | The Constant e_NoCaption.
int | e_NoIcon | This enum represents the Icon and Caption Relation of the Widget annotation e_NoIcon - No icon; caption only e_NoCaption - No caption; icon only e_CBelowI - Caption below the icon e_CAboveI - Caption above the icon e_CRightILeft - Caption to the right of the icon e_CLeftIRight - Caption to the left of the icon e_COverlayI - Caption overlaid directly on the icon Default value: e_NoIcon.
int | e_Proportional | The Constant e_Proportional.
int | e_WhenBigger | The Constant e_WhenBigger.
int | e_WhenSmaller | The Constant e_WhenSmaller.
int | e_invert | The Constant e_invert.
int | e_none | This integer list spedifies the Highlighting mode of the Widget Annotation e_none - No highlighting.
int | e_outline | The Constant e_outline.
int | e_push | The Constant e_push.
int | e_toggle | The Constant e_toggle.

[Expand] Inherited Constants
From class com.pdftron.pdf.Annot
int | e_3D | The Constant e_3D.
int | e_Caret | The Constant e_Caret.
int | e_Circle | The Constant e_Circle.
int | e_FileAttachment | The Constant e_FileAttachment.
int | e_FreeText | The Constant e_FreeText.
int | e_Highlight | The Constant e_Highlight.
int | e_Ink | The Constant e_Ink.
int | e_Line | The Constant e_Line.
int | e_Link | The Constant e_Link.
int | e_Movie | The Constant e_Movie.
int | e_Polygon | The Constant e_Polygon.
int | e_Polyline | The Constant e_Polyline.
int | e_Popup | The Constant e_Popup.
int | e_PrinterMark | The Constant e_PrinterMark.
int | e_Projection | The Constant e_Projection.
int | e_Redact | The Constant e_Redact.
int | e_RichMedia | The Constant e_RichMedia.
int | e_Screen | The Constant e_Screen.
int | e_Sound | The Constant e_Sound.
int | e_Square | The Constant e_Square.
int | e_Squiggly | The Constant e_Squiggly.
int | e_Stamp | The Constant e_Stamp.
int | e_StrikeOut | The Constant e_StrikeOut.
int | e_Text | PDF supports the standard annotation types listed in the following enumeration (plug-in extensions may add new annotation types):.
int | e_TrapNet | The Constant e_TrapNet.
int | e_Underline | The Constant e_Underline.
int | e_Unknown | The Constant e_Unknown.
int | e_Watermark | The Constant e_Watermark.
int | e_Widget | The Constant e_Widget.
int | e_action_trigger_activate | Triggered when the annotation is activated.
int | e_action_trigger_annot_blur | Triggered when the annotation loses the input focus
int | e_action_trigger_annot_down | Triggered when the mouse button is pressed inside the annotation's active area
int | e_action_trigger_annot_enter | Triggered when the cursor enters the annotation's active area
int | e_action_trigger_annot_exit | Triggered when the cursor exits the annotation's active area
int | e_action_trigger_annot_focus | Triggered when the annotation receives the input focus
int | e_action_trigger_annot_page_close | Triggered when the page containing the annotation is closed
int | e_action_trigger_annot_page_invisible | Triggered when the page containing the annotation is no longer visible in the interactive PDF processor's user interface
int | e_action_trigger_annot_page_open | Triggered when the page containing the annotation is opened
int | e_action_trigger_annot_page_visible | Triggered when the page containing the annotation becomes visible
int | e_action_trigger_annot_up | Triggered when the mouse button is released inside the annotation's active area
int | e_down | The Constant e_down.
int | e_hidden | The Constant e_hidden.
int | e_invisible | Flags specifying various characteristics of the annotation.
int | e_locked | The Constant e_locked.
int | e_locked_contents | The Constant e_locked_contents.
int | e_no_rotate | The Constant e_no_rotate.
int | e_no_view | The Constant e_no_view.
int | e_no_zoom | The Constant e_no_zoom.
int | e_normal | An annotation can define as many as three separate appearances: The normal appearance is used when the annotation is not interacting with the user.
int | e_print | The Constant e_print.
int | e_read_only | The Constant e_read_only.
int | e_rollover | The Constant e_rollover.
int | e_toggle_no_view | The Constant e_toggle_no_view.

Public Constructors
| Widget(Obj d) Creates a Widget annotation and initializes it using given Cos/SDF object.
| Widget() Create an empty Widget annotation.
| Widget(Annot annot) Creates a Widget annotation and initializes it using given annotation object.

Public Methods
void | SetScaleCondition(int sd) Set the condition under which the icon should be scaled.
static Widget | create(Doc doc, Rect pos, Field field) Creates a new Widget annotation, in the specified document.
Action | getAction() Get the action of the Widget annotation.
ColorPt | getBackgroundColor() Get the background color of the Widget annotation.
int | getBackgroundColorCompNum() Get the number indicating background color space of the Widget annotation.
ColorPt | getBorderColor() Get the border color of the Widget annotation.
int | getBorderColorCompNum() Get the number indicating border color space of the Widget annotation.
Field | getField() Get the field corresponding to the Widget annotation.
boolean | getFitFull() Get the fit full option being used.
Font | getFont() Retrieves the font used for displaying text in this Widget.
double | getFontSize() Returns the font size used in this Widget Annotation.
double | getHIconLeftOver() Get the horizontal leftover of the icon within the annotatin.
int | getHighlightingMode() Get the HighlightingMode of the Widget Annotation.
int | getIconCaptionRelation() Get the Icon and caption relationship of the Widget annotation.
String | getMouseDownCaptionText() Get the button down caption text of the Widget annotation.
Obj | getMouseDownIcon() Get the Mouse Down icon associated with the Widget annotation.
String | getRolloverCaptionText() Get the roll over caption text of the Widget annotation.
Obj | getRolloverIcon() Get the rollover icon associated with the Widget annotation.
int | getScaleCondition() Get the condition under which the icon should be scaled.
int | getScaleType() Get the Scale Type of the Widget annotation.
String | getStaticCaptionText() Get static caption text of the Widget annotation.
Obj | getStaticIcon() Get the static icon associated with the Widget annotation.
ColorPt | getTextColor() Returns the text color of the Widget Annotation.
int | getTextColorCompNum() Returns the number of color components in the text color of the Widget Annotation.
double | getVIconLeftOver() Get the vertical leftover of the icon within the annotatin.
void | setAction(Action action) Set the action of the Widget annotation (Optional; PDF 1.2 ) Note: The action is an action that shall be performed when the annotation is activated
void | setBackgroundColor(ColorPt c, int CompNum) Set the background color of the Widget.
void | setBorderColor(ColorPt c, int CompNum) Set the border color of the Widget.
void | setFitFull(boolean ff) Set the fit full option being used.
void | setFont(Font font) Specifies a font to be used for text in this Widget.
void | setFontSize(double font_size) Sets the font size of the Widget Annotation.
void | setHIconLeftOver(double hl) Set the horizontal leftover of the icon within the annotatin.
void | setHighlightingMode(int mode) Set the HighlightingMode of the Widget Annotation.
void | setIconCaptionRelation(int icr) Set the Icon and caption relationship of the Widget annotation.
void | setMouseDownCaptionText(String ct) Set the button down caption text of the Widget annotation.
void | setMouseDownIcon(Obj ic) Set the Mouse Down icon associated with the Widget annotation.
void | setRolloverCaptionText(String ct) Set the roll over caption text of the Widget annotation.
void | setRolloverIcon(Obj ic) Set the rollover icon associated with the Widget annotation.
void | setScaleType(int st) Set the Scale Type of the Widget annotation.
void | setStaticCaptionText(String ct) Set static caption text of the Widget annotation.
void | setStaticIcon(Obj ic) Set the static icon associated with the Widget annotation.
void | setTextColor(ColorPt color, int col_comp) Sets the text color of the Widget Annotation.
void | setVIconLeftOver(double vl) Set the vertical leftover of the icon within the annotatin.

[Expand] Inherited Methods
From class com.pdftron.pdf.Annot
int | GetStructParent() Get the struct parent of an annotation.
static Annot | __Create(long impl, Object ref)
long | __GetHandle()
Object | __GetRefHandle()
static Annot | create(Doc doc, int type, Rect pos) Creates a new annotation of a given type, in the specified document.
void | deleteCustomData(String key) Deletes custom data associated with the given key.
boolean | equals(Object d) Compares two annotations for equality.
void | flatten(Page page) Flatten/Merge the existing annotation appearances with the page content and delete this annotation from a given page.
String | getActiveAppearanceState() Get the annotation's active appearance state.
Obj | getAppearance(int annot_state, String app_state) Get the annotation's appearance for the given combination of annotation and appearance states.
Obj | getAppearance() Get the annotation's appearance for the given combination of annotation and appearance states.
Obj | getAppearance(int annot_state) Get the annotation's appearance for the given combination of annotation and appearance states.
Annot.BorderStyle | getBorderStyle() Get the border style for the annotation.
ColorPt | getColorAsCMYK() Get an annotation's color.
ColorPt | getColorAsGray() Get an annotation's color.
ColorPt | getColorAsRGB() Get an annotation's color.
int | getColorCompNum() Get the color space the annotation's color is represented in.
String | getContents() Get the annotation contents.
String | getCustomData(String key) Returns custom data associated with the given key.
Date | getDate() Gets an annotation's last modified date.
boolean | getFlag(int flag) Determine if the give flag is marked flagged
Obj | getOptionalContent() Get optional content of an annotation.
Page | getPage() Get the page the annotation is associated with.
Rect | getRect() Get annoation bound rectangle
int | getRotation() Get the rotation value of the annotation.
Obj | getSDFObj() Get the SDFObj.
Obj | getTriggerAction(int trigger) Get the Action associated with the selected Annot Trigger event.
int | getType() Get the annotation type.
Obj | getUniqueID() Get the annotiation unique ID.
Rect | getVisibleContentBox() It is possible during viewing that GetRect does not return the most accurate bounding box of what is actually rendered.
int | hashCode()
boolean | isMarkup() Checks if annoation is markup.
boolean | isValid() Checks if Annot is valid.
void | refreshAppearance() Regenerates the appearance stream for the annotation.
void | refreshAppearance(RefreshOptions opts) A version of RefreshAppearance allowing custom options to make slight tweaks in behaviour.
void | removeAppearance() Removes the annotation's default appearance.
void | removeAppearance(int annot_state, String app_state) Removes the annotation's appearance for the given combination of annotation and appearance states.
void | resize(Rect pos) Resize annotation
void | setActiveAppearanceState(String astate) Set the annotation's active appearance state.
void | setAppearance(Obj app_stream, int annot_state) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setAppearance(Obj app_stream) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setAppearance(Obj app_stream, int annot_state, String app_state) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setBorderStyle(Annot.BorderStyle bs) Set the border style for the annotation.
void | setColor(ColorPt cpt) Set an annotation's color.
void | setColor(ColorPt cpt, int comp_num) Set an annotation's color.
void | setContents(String ct) Set annotation contents.
void | setCustomData(String key, String value) Sets the custom data associated with the specified key.
void | setDate(Date date) Sets an annotation's last modified date.
void | setDateToNow() Sets an annotation's last modified date to the current time.
void | setFlag(int flag, boolean value) Set the value of given Flag.
void | setOptionalContent(Obj oc) Set optional content of an annotation.
void | setPage(Page page) Set the reference to a page the annotation is associated with.
void | setRect(Rect pos) Set the size and location of an annotation on its page.
void | setRotation(int rot) Set the rotation value of the annotation.
void | setStructParent(int keyval) Set the struct parent of an annotation.
void | setUniqueID(String icon_name) Set the unique identifier for this annotation.
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Constants

#### public static final int e_Always

This enum represents the circumstances under which the icon shall be scaled inside the annotation rectangle . e_Always, e_WhenBigger, e_WhenSmaller, e_Never

Constant Value: 0 (0x00000000)

#### public static final int e_Anamorphic

This integer list represents the scale type of the Widget annotation e_Anamorphic - Scale the icon to fill the annotation rectangle exactly, without regard to its original aspect ratio (ratio of width to height). e_Proportional - 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, use the smaller of the two, centering the icon within the annotation rectangle in the other dimension. Default value: e_Proportional.

Constant Value: 0 (0x00000000)

#### public static final int e_CAboveI

The Constant e_CAboveI.

Constant Value: 3 (0x00000003)

#### public static final int e_CBelowI

The Constant e_CBelowI.

Constant Value: 2 (0x00000002)

#### public static final int e_CLeftIRight

The Constant e_CLeftIRight.

Constant Value: 5 (0x00000005)

#### public static final int e_COverlayI

The Constant e_COverlayI.

Constant Value: 6 (0x00000006)

#### public static final int e_CRightILeft

The Constant e_CRightILeft.

Constant Value: 4 (0x00000004)

#### public static final int e_Never

The Constant e_Never.

Constant Value: 3 (0x00000003)

#### public static final int e_NoCaption

The Constant e_NoCaption.

Constant Value: 1 (0x00000001)

#### public static final int e_NoIcon

This enum represents the Icon and Caption Relation of the Widget annotation e_NoIcon - No icon; caption only e_NoCaption - No caption; icon only e_CBelowI - Caption below the icon e_CAboveI - Caption above the icon e_CRightILeft - Caption to the right of the icon e_CLeftIRight - Caption to the left of the icon e_COverlayI - Caption overlaid directly on the icon Default value: e_NoIcon.

Constant Value: 0 (0x00000000)

#### public static final int e_Proportional

The Constant e_Proportional.

Constant Value: 1 (0x00000001)

#### public static final int e_WhenBigger

The Constant e_WhenBigger.

Constant Value: 1 (0x00000001)

#### public static final int e_WhenSmaller

The Constant e_WhenSmaller.

Constant Value: 2 (0x00000002)

#### public static final int e_invert

The Constant e_invert.

Constant Value: 1 (0x00000001)

#### public static final int e_none

This integer list spedifies the Highlighting mode of the Widget Annotation e_none - No highlighting. e_invert - Invert the contents of the annotation rectangle. e_outline - Invert the annotation's border. e_push - Display the annotation's down appearance, if any e_toggle - Same as e_push (which is preferred).

Constant Value: 0 (0x00000000)

#### public static final int e_outline

The Constant e_outline.

Constant Value: 2 (0x00000002)

#### public static final int e_push

The Constant e_push.

Constant Value: 3 (0x00000003)

#### public static final int e_toggle

The Constant e_toggle.

Constant Value: 4 (0x00000004)

## Public Constructors

#### public Widget (Obj d)

Creates a Widget annotation and initializes it using given Cos/SDF object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

##### Parameters

d | The Cos/SDF object to initialze the annotation with.

#### public Widget ()

Create an empty Widget annotation.

#### public Widget (Annot annot)

Creates a Widget annotation and initializes it using given annotation object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

##### Parameters

annot | the annot

##### Throws

PDFNetException |

## Public Methods

#### public void SetScaleCondition (int sd)

Set the condition under which the icon should be scaled. (Optional)

Note: the ScaleCondition spedifies the circumstances under which the icon shall be scaled inside the annotation rectangle. The options are as follows: e_Always - Always scale. e_WhenBigger - Scale only when the icon is bigger than the annotation rectangle. e_WhenSmaller - Scale only when the icon is smaller than the annotation rectangle. e_Never - Never scale. Default value: e_Always.

This property is part of the Icon Fit dictionary, where the Icon Fit dictionary specifys how to display the button's icon within the annotation rectangle of its widget annotation(Optional; pushbutton fields only) If present, the icon fit dictionary shall apply to all of the annotation's icons (normal, rollover, and alternate).

##### Parameters

sd | An entry of the "ScaleCondition" enum which the icon should be scaled.

##### Throws

PDFNetException |

#### public static Widget create (Doc doc, Rect pos, Field field)

Creates a new Widget annotation, in the specified document.

##### Parameters

doc | The document to which the annotation is to be added.
pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.
field | The field for which to create a widget.

##### Returns

- A newly created blank Widget annotation.

##### Throws

PDFNetException |

#### public Action getAction ()

Get the action of the Widget annotation.

##### Returns

- An action object representing the action of the Widget annotation.

##### Throws

PDFNetException | * Note: The action is an action that shall be performed when the annotation is activated

#### public ColorPt getBackgroundColor ()

Get the background color of the Widget annotation.

Note: that the color can be in different color spaces: Gray, RGB, or CMYK. Call "GetBackgroundColorCompNum" to access the color space information corresponding to the border color. This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- A ColorPt object that denotes the color of the Widget background.

##### Throws

PDFNetException |

#### public int getBackgroundColorCompNum ()

Get the number indicating background color space of the Widget annotation.

Note: This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- An integer indicating a color space value from the ColorSpace::Type enum. That is, 1 corresponding to "e_device_gray", 3 corresponding to "e_device_rgb", and 4 corresponding to "e_device_cmyk" if color space is applicable, orelse 0 corresponding to "e_null" if the color is transparent.

##### Throws

PDFNetException |

#### public ColorPt getBorderColor ()

Get the border color of the Widget annotation.

Note: that the color can be in different color spaces: Gray, RGB, or CMYK. Call "GetBorderColorCompNum" to access the color space information corresponding to the border color.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- A ColorPt object that denotes the color of the Widget border.

##### Throws

PDFNetException |

#### public int getBorderColorCompNum ()

Get the number indicating border color space of the Widget annotation.

Note: This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- An integer indicating a color space value from the ColorSpace::Type enum. That is, 1 corresponding to "e_device_gray", 3 corresponding to "e_device_rgb", and 4 corresponding to "e_device_cmyk" if color space is applicable, orelse 0 corresponding to "e_null" if the color is transparent.

##### Throws

PDFNetException |

#### public Field getField ()

Get the field corresponding to the Widget annotation.

##### Returns

- A Field object.

##### Throws

PDFNetException |

#### public boolean getFitFull ()

Get the fit full option being used.

Note: the FitFull value, 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. Default value: false.

##### Returns

- A boolean value indicating the fit full option being used.

##### Throws

PDFNetException |

#### public Font getFont ()

Retrieves the font used for displaying text in this Widget.

##### Returns

- the font used by this Widget.

##### Throws

PDFNetException |

#### public double getFontSize ()

Returns the font size used in this Widget Annotation.

Note: A font size of 0 specifies that the text should be autosized to fit in the Widget.

##### Returns

- the font size

##### Throws

PDFNetException |

#### public double getHIconLeftOver ()

Get the horizontal leftover of the icon within the annotatin.

Note: the horizontal leftover is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the left. A value of 0.0 shall position the icon at the left of the annotation rectangle. A value of 0.5 shall center it in the horizontal direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.

##### Returns

- A number indicating the horizontal leftover of the icon within the annotation.

##### Throws

PDFNetException |

#### public int getHighlightingMode ()

Get the HighlightingMode of the Widget Annotation.

Note: The annotation's highlighting mode is the visual effect that shall be used when the mouse button is pressed or held down inside its active area: e_none - No highlighting. e_invert - Invert the contents of the annotation rectangle. e_outline - Invert the annotation's border. e_push - Display the annotation's down appearance, if any If no down appearance is defined, the contents of the annotation rectangle shall be offset to appear as if it were being pushed below the surface of the page. e_toggle - Same as e_push (which is preferred). A highlighting mode other than e_push shall override any down appearance defined for the annotation. Default value: e_invert.

##### Returns

- an entry of the enum "HighlightingMode", specifying the highlighting mode of the widget annotation.

##### Throws

PDFNetException |

#### public int getIconCaptionRelation ()

Get the Icon and caption relationship of the Widget annotation.

Note: the IconCaptionRelation entry indicates where to position the text of the widget annotation's caption relative to its icon, the options are as follows: e_NoIcon - No icon; caption only e_NoCaption - No caption; icon only e_CBelowI - Caption below the icon e_CAboveI - Caption above the icon e_CRightILeft - Caption to the right of the icon e_CLeftIRight - Caption to the left of the icon e_CoverlayI - Caption overlaid directly on the icon Default value: e_NoIcon.

##### Returns

- An entry of the "IconCaptionRelation" enum which represents the relationship between the icon and the caption of the Widget annotation.

##### Throws

PDFNetException |

#### public String getMouseDownCaptionText ()

Get the button down caption text of the Widget annotation.

Note: The button down caption shall be displayed when the mouse button is pressed within its active area.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- A string containing the button down text of the Widget annotation.

##### Throws

PDFNetException |

#### public Obj getMouseDownIcon ()

Get the Mouse Down icon associated with the Widget annotation.

Note: The Mouse Down icon object is a form XObject defining the widget annotation's alternate (down) icon, which shall be displayed when the mouse button is pressed within its active area.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- An SDF object that represents the Mouse Down icon associated with the Widget annotation.

##### Throws

PDFNetException |

#### public String getRolloverCaptionText ()

Get the roll over caption text of the Widget annotation.

Note: The rollover caption shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- A string containing the static caption text of the Widget annotation.

##### Throws

PDFNetException |

#### public Obj getRolloverIcon ()

Get the rollover icon associated with the Widget annotation.

Note: The rollover icon object is a form XObject defining the widget annotation's rollover icon, which shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- An SDF object that represents the rollover icon associated with the Widget annotation.

##### Throws

PDFNetException |

#### public int getScaleCondition ()

Get the condition under which the icon should be scaled.

Note: the ScaleCondition spedifies the circumstances under which the icon shall be scaled inside the annotation rectangle. The options are as follows: e_Always - Always scale. e_WhenBigger - Scale only when the icon is bigger than the annotation rectangle. e_WhenSmaller - Scale only when the icon is smaller than the annotation rectangle. e_Never - Never scale. Default value: e_Always.

This property is part of the Icon Fit dictionary, where the Icon Fit dictionary specifys how to display the button's icon within the annotation rectangle of its widget annotation(Optional; pushbutton fields only) If present, the icon fit dictionary shall apply to all of the annotation's icons (normal, rollover, and alternate).

##### Returns

- an entry of the "ScaleCondition" enum which the icon should be scaled.

##### Throws

PDFNetException |

#### public int getScaleType ()

Get the Scale Type of the Widget annotation.

Note: The type of scaling that shall be used: e_Anamorphic - Anamorphic scaling: Scale the icon to fill the annotation rectangle exactly, without regard to its original aspect ratio (ratio of width to height). e_Proportional - Proportional scaling: 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, use the smaller of the two, centering the icon within the annotation rectangle in the other dimension. Default value: P.

This property is part of the Icon Fit dictionary, where the Icon Fit dictionary specifys how to display the button's icon within the annotation rectangle of its widget annotation(Optional; pushbutton fields only) If present, the icon fit dictionary shall apply to all of the annotation's icons (normal, rollover, and alternate).

##### Returns

- An entry of the "ScaleType" enum which represents the Scale Type of the Widget annotation.

##### Throws

PDFNetException |

#### public String getStaticCaptionText ()

Get static caption text of the Widget annotation.

Note: The static caption is the widget annotation's normal caption, which shall be displayed when it is not interacting with the user. Unlike the remaining entries with the captions, which apply only to widget annotations associated with pushbutton fields, the Static Caption(CA) entry may be used with any type of button field, including check boxes.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- A string containing the static caption text of the Widget annotation.

##### Throws

PDFNetException |

#### public Obj getStaticIcon ()

Get the static icon associated with the Widget annotation.

Note: The static icon object is a form XObject defining the widget annotation's normal icon, which shall be displayed when it is not interacting with the user.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- An SDF object that represents the static icon associated with the Widget annotation.

##### Throws

PDFNetException |

#### public ColorPt getTextColor ()

Returns the text color of the Widget Annotation.

Note: Cthe color can be in different color spaces: Gray, RGB, or CMYK. Call "GetTextColorCompNum" to access the color space information corresponding to the border color.

##### Returns

- the text color.

##### Throws

PDFNetException |

#### public int getTextColorCompNum ()

Returns the number of color components in the text color of the Widget Annotation.

##### Returns

- An integer indicating a color space value from the ColorSpace::Type enum. That is, 1 corresponding to "e_device_gray", 3 corresponding to "e_device_rgb", and 4 corresponding to "e_device_cmyk" if color space is applicable.

##### Throws

PDFNetException |

#### public double getVIconLeftOver ()

Get the vertical leftover of the icon within the annotatin.

Note: the vertical leftover is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the bottom of the icon. A value of 0.0 shall position the icon at the bottom of the annotation rectangle. A value of 0.5 shall center it in the vertical direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.

##### Returns

- a number indicating the vertical leftover of the icon within the annotation.

##### Throws

PDFNetException |

#### public void setAction (Action action)

Set the action of the Widget annotation (Optional; PDF 1.2 )

Note: The action is an action that shall be performed when the annotation is activated

##### Parameters

action | An action object representing the action of the Widget annotation.

##### Throws

PDFNetException |

#### public void setBackgroundColor (ColorPt c, int CompNum)

Set the background color of the Widget. (Optional)

Note: This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Parameters

c | A ColorPt object that denotes the color of the wdget background.
CompNum | An int whose value implies the color space used for the parameter c.

##### Throws

PDFNetException | * Note: it is necessary to make sure the consistancy between the ColorPt type and the ColorSpace::Type value. e_device_gray corresponds to an array of two numbers; e_device_rgb corresponds to an array of 3 numbers, e_device_cmyk corresponds to an array of 4 numnbers, while e_null correspons to an arry of 0 number. Entries out of the specified color space array length will be desgarded. However, missing entries for a specified color space will throw exception either when setting the color or when later retrieving color(colorspace) information.

#### public void setBorderColor (ColorPt c, int CompNum)

Set the border color of the Widget. (Optional)

Note: it is necessary to make sure the consistancy between the ColorPt type and the ColorSpace::Type value. e_device_gray corresponds to an array of two numbers; e_device_rgb corresponds to an array of 3 numbers, e_device_cmyk corresponds to an array of 4 numnbers, while e_null correspons to an arry of 0 number. Entries out of the specified color space array length will be desgarded. However, missing entries for a specified color space will throw exception either when setting the color or when later retrieving color(colorspace) information.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Parameters

c | A ColorPt object that denotes the color of the wdget border.
CompNum | An int whose value implies the color space used for the parameter c.

##### Throws

PDFNetException |

#### public void setFitFull (boolean ff)

Set the fit full option being used. (Optional)

Note: the FitFull value, 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. Default value: false.

##### Parameters

ff | A boolean value indicating the fit full option being used.

##### Throws

PDFNetException |

#### public void setFont (Font font)

Specifies a font to be used for text in this Widget.

##### Parameters

font | the font to use.

##### Throws

PDFNetException |

#### public void setFontSize (double font_size)

Sets the font size of the Widget Annotation.

Note: A font size of 0 specifies that the text should be autosized to fit in the Widget.

##### Parameters

font_size | the new font size

##### Throws

PDFNetException |

#### public void setHIconLeftOver (double hl)

Set the horizontal leftover of the icon within the annotatin. (Optional)

Note: the horizontal leftover is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the left. A value of 0.0 shall position the icon at the left of the annotation rectangle. A value of 0.5 shall center it in the horizontal direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.

##### Parameters

hl | A number indicating the horizontal leftover of the icon within the annotation.

##### Throws

PDFNetException |

#### public void setHighlightingMode (int mode)

Set the HighlightingMode of the Widget Annotation. (Optional)

Note: The annotation's highlighting mode is the visual effect that shall be used when the mouse button is pressed or held down inside its active area: e_none - No highlighting. e_invert - Invert the contents of the annotation rectangle. e_outline - Invert the annotation's border. e_push - Display the annotation's down appearance, if any If no down appearance is defined, the contents of the annotation rectangle shall be offset to appear as if it were being pushed below the surface of the page. e_toggle - Same as e_push (which is preferred). A highlighting mode other than e_push shall override any down appearance defined for the annotation. Default value: e_invert.

##### Parameters

mode | - an entry of the enum "HighlightingMode", specifying the highlighting mode of the widget annotation.

##### Throws

PDFNetException |

#### public void setIconCaptionRelation (int icr)

Set the Icon and caption relationship of the Widget annotation. (Optional; pushbutton fields only)

Note: the IconCaptionRelation entry indicates where to position the text of the widget annotation's caption relative to its icon. The options are as follows: e_NoIcon - No icon; caption only e_NoCaption - No caption; icon only e_CBelowI - Caption below the icon e_CAboveI - Caption above the icon e_CRightILeft - Caption to the right of the icon e_CLeftIRight - Caption to the left of the icon e_CoverlayI - Caption overlaid directly on the icon Default value: e_NoIcon.

##### Parameters

icr | An entry of the "IconCaptionRelation" enum which represents the relationship between the icon and the caption of the Widget annotation.

##### Throws

PDFNetException |

#### public void setMouseDownCaptionText (String ct)

Set the button down caption text of the Widget annotation. (Optional; button fields only)

Note: The button down caption shall be displayed when the mouse button is pressed within its active area.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Parameters

ct | A string containing the button down text of the Widget annotation.

##### Throws

PDFNetException |

#### public void setMouseDownIcon (Obj ic)

Set the Mouse Down icon associated with the Widget annotation. (Optional; button fields only) Set the Mouse Down icon associated with the Widget annotation.

Note: The Mouse Down icon object is a form XObject defining the widget annotation's alternate (down) icon, which shall be displayed when the mouse button is pressed within its active area.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Parameters

ic | An SDF object that represents the Mouse Down icon associated with the Widget annotation.

##### Throws

PDFNetException |

#### public void setRolloverCaptionText (String ct)

Set the roll over caption text of the Widget annotation. (Optional; button fields only)

Note: The rollover caption shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.

##### Parameters

ct | A string containing the roll over caption text of the Widget annotation.

##### Throws

PDFNetException |

#### public void setRolloverIcon (Obj ic)

Set the rollover icon associated with the Widget annotation. (Optional; button fields only)

Note: The rollover icon object is a form XObject defining the widget annotation's rollover icon, which shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Parameters

ic | An SDF object that represents the rollover icon associated with the Widget annotation.

##### Throws

PDFNetException |

#### public void setScaleType (int st)

Set the Scale Type of the Widget annotation. (Optional)

Note: The type of scaling that shall be used: e_Anamorphic - Anamorphic scaling: Scale the icon to fill the annotation rectangle exactly, without regard to its original aspect ratio (ratio of width to height). e_Proportional - Proportional scaling: 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, use the smaller of the two, centering the icon within the annotation rectangle in the other dimension. Default value: P.

This property is part of the Icon Fit dictionary, where the Icon Fit dictionary specifys how to display the button's icon within the annotation rectangle of its widget annotation(Optional; pushbutton fields only) If present, the icon fit dictionary shall apply to all of the annotation's icons (normal, rollover, and alternate).

##### Parameters

st | - an entry of the "ScaleType" enum which represents the Scale Type of the Widget annotation.

##### Throws

PDFNetException |

#### public void setStaticCaptionText (String ct)

Set static caption text of the Widget annotation. (Optional; button fields only)

Note: The static caption is the widget annotation's normal caption, which shall be displayed when it is not interacting with the user. Unlike entries "RC, AC, I, RI, IX, IF, TP", which apply only to widget annotations associated with pushbutton fields, the Static Caption(CA) entry may be used with any type of button field, including check boxes.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Parameters

ct | A string containing the static caption text of the Widget annotation.

##### Throws

PDFNetException |

#### public void setStaticIcon (Obj ic)

Set the static icon associated with the Widget annotation. (Optional; button fields only)

Note: The static icon object is a form XObject defining the widget annotation's normal icon, which shall be displayed when it is not interacting with the user.

This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Parameters

ic | An SDF object that represents the static icon associated with the Widget annotation.

##### Throws

PDFNetException |

#### public void setTextColor (ColorPt color, int col_comp)

Sets the text color of the Widget Annotation.

##### Parameters

color | ColorPt object representing the color.
col_comp | An integer indicating a color space value from the ColorSpace::Type enum. That is, 1 corresponding to "e_device_gray", 3 corresponding to "e_device_rgb", and 4 corresponding to "e_device_cmyk".

##### Throws

PDFNetException |

#### public void setVIconLeftOver (double vl)

Set the vertical leftover of the icon within the annotatin. (Optional)

Note: the vertical leftover is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the bottom of the icon. A value of 0.0 shall position the icon at the bottom of the annotation rectangle. A value of 0.5 shall center it in the vertical direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.

##### Parameters

vl | A number indicating the vertical leftover of the icon within the annotation.

##### Throws

PDFNetException |