Module: PDF::Core::Annotations Private
- Defined in:
- lib/pdf/core/annotations.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Provides very low-level support for annotations.
Instance Method Summary collapse
-
#annotate(options) ⇒ options
private
Adds a new annotation (section *8.4 Annotations* in PDF 1.7 spec) to the current page.
-
#link_annotation(rect, options = {}) ⇒ Hash
private
A convenience method for creating ‘Link` annotations.
-
#text_annotation(rect, contents, options = {}) ⇒ Hash
private
A convenience method for creating ‘Text` annotations.
Instance Method Details
#annotate(options) ⇒ options
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Adds a new annotation (section *8.4 Annotations* in PDF 1.7 spec) to the current page.
50 51 52 53 54 55 |
# File 'lib/pdf/core/annotations.rb', line 50 def annotate() state.page.dictionary.data[:Annots] ||= [] = sanitize_annotation_hash() state.page.dictionary.data[:Annots] << ref!() end |
#link_annotation(rect, options = {}) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
A convenience method for creating ‘Link` annotations.
79 80 81 82 |
# File 'lib/pdf/core/annotations.rb', line 79 def link_annotation(rect, = {}) = .merge(Subtype: :Link, Rect: rect) annotate() end |
#text_annotation(rect, contents, options = {}) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
A convenience method for creating ‘Text` annotations.
64 65 66 67 |
# File 'lib/pdf/core/annotations.rb', line 64 def text_annotation(rect, contents, = {}) = .merge(Subtype: :Text, Rect: rect, Contents: contents) annotate() end |