Class: Pdfrb::Model::Type::Annotation
Instance Attribute Summary
Attributes inherited from Object
#document, #gen, #oid, #value
Class Method Summary
collapse
Instance Method Summary
collapse
#[], #[]=, 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
Class Method Details
.for_subtype(symbol) ⇒ Object
82
83
84
|
# File 'lib/pdfrb/model/type/annotation.rb', line 82
def for_subtype(symbol)
subtype_map[symbol]
end
|
.register_subtype(symbol, klass = self) ⇒ Object
78
79
80
|
# File 'lib/pdfrb/model/type/annotation.rb', line 78
def register_subtype(symbol, klass = self)
subtype_map[symbol] = klass
end
|
.subtype_map ⇒ Object
74
75
76
|
# File 'lib/pdfrb/model/type/annotation.rb', line 74
def subtype_map
@subtype_map ||= {}
end
|
Instance Method Details
37
|
# File 'lib/pdfrb/model/type/annotation.rb', line 37
def action; self[:A]; end
|
#additional_actions ⇒ Object
38
|
# File 'lib/pdfrb/model/type/annotation.rb', line 38
def additional_actions; self[:AA]; end
|
#appearance ⇒ Object
35
|
# File 'lib/pdfrb/model/type/annotation.rb', line 35
def appearance; self[:AP]; end
|
#appearance_state ⇒ Object
36
|
# File 'lib/pdfrb/model/type/annotation.rb', line 36
def appearance_state; self[:AS]; end
|
34
|
# File 'lib/pdfrb/model/type/annotation.rb', line 34
def border; self[:Border]; end
|
33
|
# File 'lib/pdfrb/model/type/annotation.rb', line 33
def color; self[:C]; end
|
29
|
# File 'lib/pdfrb/model/type/annotation.rb', line 29
def contents; self[:Contents]; end
|
#create_appearance_stream ⇒ Object
68
69
70
|
# File 'lib/pdfrb/model/type/annotation.rb', line 68
def create_appearance_stream
AppearanceGenerator.for(self, document: document)&.create_appearance
end
|
32
|
# File 'lib/pdfrb/model/type/annotation.rb', line 32
def flags; self[:F] || 0; end
|
#hidden? ⇒ Boolean
---- Flag predicates ----
49
|
# File 'lib/pdfrb/model/type/annotation.rb', line 49
def hidden?; flags & 1 != 0; end
|
#locked? ⇒ Boolean
55
|
# File 'lib/pdfrb/model/type/annotation.rb', line 55
def locked?; flags & 128 != 0; end
|
#locked_contents? ⇒ Boolean
57
|
# File 'lib/pdfrb/model/type/annotation.rb', line 57
def locked_contents?; flags & 512 != 0; end
|
#modified_date ⇒ Object
31
|
# File 'lib/pdfrb/model/type/annotation.rb', line 31
def modified_date; self[:M]; end
|
30
|
# File 'lib/pdfrb/model/type/annotation.rb', line 30
def name; self[:NM]; end
|
#no_rotate? ⇒ Boolean
52
|
# File 'lib/pdfrb/model/type/annotation.rb', line 52
def no_rotate?; flags & 8 != 0; end
|
#no_view? ⇒ Boolean
53
|
# File 'lib/pdfrb/model/type/annotation.rb', line 53
def no_view?; flags & 16 != 0; end
|
#no_zoom? ⇒ Boolean
51
|
# File 'lib/pdfrb/model/type/annotation.rb', line 51
def no_zoom?; flags & 4 != 0; end
|
#normal_appearance ⇒ Object
---- Appearance management ----
60
61
62
63
64
65
66
|
# File 'lib/pdfrb/model/type/annotation.rb', line 60
def normal_appearance
ap = appearance
return nil unless ap
ap = document.object(ap) if ap.is_a?(Pdfrb::Model::Reference) && document
ap && ap[:N]
end
|
41
42
43
44
45
46
|
# File 'lib/pdfrb/model/type/annotation.rb', line 41
def page
ref = self[:P]
return nil unless ref && document
document.object(ref)
end
|
#print? ⇒ Boolean
50
|
# File 'lib/pdfrb/model/type/annotation.rb', line 50
def print?; flags & 2 != 0; end
|
#read_only? ⇒ Boolean
54
|
# File 'lib/pdfrb/model/type/annotation.rb', line 54
def read_only?; flags & 32 != 0; end
|
28
|
# File 'lib/pdfrb/model/type/annotation.rb', line 28
def rect; self[:Rect]; end
|
27
|
# File 'lib/pdfrb/model/type/annotation.rb', line 27
def subtype; self[:Subtype]; end
|
#toggle_no_view? ⇒ Boolean
56
|
# File 'lib/pdfrb/model/type/annotation.rb', line 56
def toggle_no_view?; flags & 256 != 0; end
|