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.
Source Code
50 | def annotate(options) |
51 | state.page.dictionary.data[:Annots] ||= [] |
52 | options = sanitize_annotation_hash(options) |
53 | state.page.dictionary.data[:Annots] << ref!(options) |
54 | options
|
55 | 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.
Source Code
79 | def link_annotation(rect, options = {}) |
80 | options = options.merge(Subtype: :Link, Rect: rect) |
81 | annotate(options) |
82 | 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.
Source Code
64 | def text_annotation(rect, contents, options = {}) |
65 | options = options.merge(Subtype: :Text, Rect: rect, Contents: contents) |
66 | annotate(options) |
67 | end
|