Class: Pdfrb::Model::Type::WidgetAnnotation

Inherits:
Annotation show all
Defined in:
lib/pdfrb/model/type/widget_annotation.rb

Instance Attribute Summary

Attributes inherited from Object

#document, #gen, #oid, #value

Instance Method Summary collapse

Methods inherited from Annotation

#appearance, #appearance_state, #border, #color, #contents, #create_appearance_stream, #flags, for_subtype, #hidden?, #locked?, #locked_contents?, #modified_date, #name, #no_rotate?, #no_view?, #no_zoom?, #normal_appearance, #page, #print?, #read_only?, #rect, register_subtype, #subtype, subtype_map, #toggle_no_view?

Methods inherited from Cos::Dictionary

#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, own_fields, #pdf_type, register_type, type_map, #validate

Methods inherited from Object

#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type

Constructor Details

This class inherits a constructor from Pdfrb::Model::Cos::Dictionary

Instance Method Details

#actionObject



11
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 11

def action; self[:A]; end

#additional_actionsObject



12
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 12

def additional_actions; self[:AA]; end

#appearance_streamObject



8
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 8

def appearance_stream; self[:AP]; end

#button_background_colorObject



21
22
23
24
25
26
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 21

def button_background_color
  return nil unless mk

  obj = mk.is_a?(Pdfrb::Model::Reference) && document ? document.object(mk) : mk
  obj && obj[:BG]
end

#button_captionObject



28
29
30
31
32
33
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 28

def button_caption
  return nil unless mk

  obj = mk.is_a?(Pdfrb::Model::Reference) && document ? document.object(mk) : mk
  obj && obj[:CA]
end

#fieldObject



7
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 7

def field; self[:Parent]; end

#has_action?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 42

def has_action?
  !!action
end

#highlight_modeObject



9
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 9

def highlight_mode; self[:H]; end

#mkObject



10
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 10

def mk; self[:MK]; end

#normal_captionObject



35
36
37
38
39
40
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 35

def normal_caption
  return nil unless mk

  obj = mk.is_a?(Pdfrb::Model::Reference) && document ? document.object(mk) : mk
  obj && obj[:CA]
end

#resolved_fieldObject



14
15
16
17
18
19
# File 'lib/pdfrb/model/type/widget_annotation.rb', line 14

def resolved_field
  ref = field
  return nil unless ref && document

  document.object(ref)
end