Class: Pdfrb::Model::Type::Annotation
Direct Known Subclasses
LinkAnnotation, MarkupAnnotation, MovieAnnotation, PolygonPolyline, PopupAnnotation, PrinterMarkAnnotation, RichMediaAnnotation, ScreenAnnotation, SquareCircle, ThreeDAnnotation, WatermarkAnnotation, WidgetAnnotation
Instance Attribute Summary
Attributes inherited from Object
#document, #gen, #oid, #value
Class Method Summary
collapse
Instance Method Summary
collapse
#[], #[]=, apply_arlington_definition, arlington_default, arlington_key_to_symbol, arlington_one_type_to_ruby, arlington_required?, arlington_scalar, 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, merged_field, own_fields, #pdf_type, register_type, type_map, #validate
#arlington_object
Methods inherited from Object
#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type, #ref
Class Method Details
.for_subtype(symbol) ⇒ Object
89
90
91
|
# File 'lib/pdfrb/model/type/annotation.rb', line 89
def for_subtype(symbol)
subtype_map[symbol]
end
|
.register_subtype(symbol, klass = self) ⇒ Object
85
86
87
|
# File 'lib/pdfrb/model/type/annotation.rb', line 85
def register_subtype(symbol, klass = self)
subtype_map[symbol] = klass
end
|
.subtype_map ⇒ Object
81
82
83
|
# File 'lib/pdfrb/model/type/annotation.rb', line 81
def subtype_map
@subtype_map ||= {}
end
|
Instance Method Details
44
|
# File 'lib/pdfrb/model/type/annotation.rb', line 44
def action; self[:A]; end
|
#additional_actions ⇒ Object
45
|
# File 'lib/pdfrb/model/type/annotation.rb', line 45
def additional_actions; self[:AA]; end
|
#appearance ⇒ Object
42
|
# File 'lib/pdfrb/model/type/annotation.rb', line 42
def appearance; self[:AP]; end
|
#appearance_state ⇒ Object
43
|
# File 'lib/pdfrb/model/type/annotation.rb', line 43
def appearance_state; self[:AS]; end
|
41
|
# File 'lib/pdfrb/model/type/annotation.rb', line 41
def border; self[:Border]; end
|
40
|
# File 'lib/pdfrb/model/type/annotation.rb', line 40
def color; self[:C]; end
|
#create_appearance_stream ⇒ Object
75
76
77
|
# File 'lib/pdfrb/model/type/annotation.rb', line 75
def create_appearance_stream
AppearanceGenerator.for(self, document: document)&.create_appearance
end
|
39
|
# File 'lib/pdfrb/model/type/annotation.rb', line 39
def flags; self[:F] || 0; end
|
#hidden? ⇒ Boolean
---- Flag predicates ----
56
|
# File 'lib/pdfrb/model/type/annotation.rb', line 56
def hidden?; flags & 1 != 0; end
|
#locked? ⇒ Boolean
62
|
# File 'lib/pdfrb/model/type/annotation.rb', line 62
def locked?; flags & 128 != 0; end
|
#locked_contents? ⇒ Boolean
64
|
# File 'lib/pdfrb/model/type/annotation.rb', line 64
def locked_contents?; flags & 512 != 0; end
|
#modified_date ⇒ Object
38
|
# File 'lib/pdfrb/model/type/annotation.rb', line 38
def modified_date; self[:M]; end
|
#no_rotate? ⇒ Boolean
59
|
# File 'lib/pdfrb/model/type/annotation.rb', line 59
def no_rotate?; flags & 8 != 0; end
|
#no_view? ⇒ Boolean
60
|
# File 'lib/pdfrb/model/type/annotation.rb', line 60
def no_view?; flags & 16 != 0; end
|
#no_zoom? ⇒ Boolean
58
|
# File 'lib/pdfrb/model/type/annotation.rb', line 58
def no_zoom?; flags & 4 != 0; end
|
#normal_appearance ⇒ Object
---- Appearance management ----
67
68
69
70
71
72
73
|
# File 'lib/pdfrb/model/type/annotation.rb', line 67
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
|
48
49
50
51
52
53
|
# File 'lib/pdfrb/model/type/annotation.rb', line 48
def page
ref = self[:P]
return nil unless ref && document
document.object(ref)
end
|
#print? ⇒ Boolean
57
|
# File 'lib/pdfrb/model/type/annotation.rb', line 57
def print?; flags & 2 != 0; end
|
#read_only? ⇒ Boolean
61
|
# File 'lib/pdfrb/model/type/annotation.rb', line 61
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
63
|
# File 'lib/pdfrb/model/type/annotation.rb', line 63
def toggle_no_view?; flags & 256 != 0; end
|