class HexaPDF:: Type:: Annotations:: Widget
| Parent | HexaPDF::Type::Annotation |
|---|---|
| Included Modules |
HexaPDF::Type::Annotations::BorderStyling |
Widget annotations are used by interactive forms to represent the appearance of fields and to manage user interactions.
See: PDF2.0 s12.5.6.19, HexaPDF::Type::Annotation
Field Definitions
| Name | Type/Allowed Values | Required | Default Value |
|---|---|---|---|
| Type | Symbol | false | :Annot |
| Subtype | Symbol | true | nil |
| Rect | HexaPDF::Rectangle or Array | true | nil |
| Contents | String | false | nil |
| P | HexaPDF::Dictionary or Hash | false | nil |
| NM | String | false | nil |
| M | HexaPDF::DictionaryFields::PDFDate or String or Time or Date or DateTime | false | nil |
| F | Integer | false | 0 |
| AP | HexaPDF::Type::Annotation::AppearanceDictionary or Hash | false | nil |
| AS | Symbol | false | nil |
| Border | HexaPDF::PDFArray or Array | false | [0, 0, 1] |
| C | HexaPDF::PDFArray or Array | false | nil |
| StructParent | Integer | false | nil |
| OC | HexaPDF::Dictionary or Hash | false | nil |
| AF | HexaPDF::PDFArray or Array | false | nil |
| ca | Numeric | false | 1.0 |
| CA | Numeric | false | 1.0 |
| BM | Symbol | false | nil |
| Lang | String | false | nil |
| Subtype | Symbol | true | :Widget |
| H | Symbol One of: :N, :I, :O, :P, :T | false | nil |
| MK | HexaPDF::Type::Annotations::Widget::AppearanceCharacteristics or Hash | false | nil |
| A | HexaPDF::Dictionary or Hash | false | nil |
| AA | HexaPDF::Dictionary or Hash | false | nil |
| BS | HexaPDF::Type::Annotation::Border or Hash | false | nil |
| Parent | HexaPDF::Dictionary or Hash | false | nil |
Public Instance Methods
Returns the current background color as device color object, or nil if no background color is set, when no argument is given. Otherwise sets the background color using the color argument and returns self.
See HexaPDF::Content::ColorSpace.device_color_from_specification for information on the allowed arguments.
Returns the AcroForm field object to which this widget annotation belongs.
Since a widget and a field can share the same dictionary object, the returned object is often just the widget re-wrapped in the correct field class.
Returns a MarkerStyle instance representing the marker style of the widget when no argument is given. Otherwise sets the button marker style of the widget and returns self.
This method returns valid information only for check boxes, radio buttons and push buttons!
When setting a marker style, arguments that are not provided will use the default:
-
For check boxes a black auto-sized checkmark (i.e. :check)
-
For radio buttons a black auto-sized circle (i.e. :circle)
-
For push buttons a black 9pt empty text using Helvetica
This also means that multiple invocations will reset all prior values.
Note that the font_name argument must be a valid HexaPDF font name (this is in contrast to MarkerStyle#font_name which returns the resource name of the font).
Note: The marker is called “normal caption” in the PDF 2.0 spec and the /CA entry of the associated appearance characteristics dictionary. The marker size and color are set using the /DA key on the widget (although /DA is not defined for widget, this is how Acrobat does it).
See: PDF2.0 s12.5.6.19 and s12.7.4.3