Module: PDF::Core::Destinations Private
- Defined in:
- lib/pdf/core/destinations.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.
Implements destination support for PDF
Constant Summary collapse
- NAME_TREE_CHILDREN_LIMIT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The maximum number of children to fit into a single node in the Dests tree.
20
Instance Method Summary collapse
-
#add_dest(name, reference) ⇒ void
private
Adds a new destination to the Dests name tree.
-
#dest_fit(dest_page = page) ⇒ Array(PDF::Core::Reference, :Fit)
private
builds a Dest specification that will fit the given page into the viewport.
-
#dest_fit_bounds(dest_page = page) ⇒ Array(PDF::Core::Reference, :FitB)
private
Builds a Dest specification that will fit the given page’s bounding box into the viewport.
-
#dest_fit_bounds_horizontally(top, dest_page = page) ⇒ Array(PDF::Core::Reference, :FitBH, Numeric)
private
Same as #dest_fit_horizontally, but works on the page’s bounding box instead of the entire page.
-
#dest_fit_bounds_vertically(left, dest_page = page) ⇒ Array(PDF::Core::Reference, :FitBV, Numeric)
private
Same as #dest_fit_vertically, but works on the page’s bounding box instead of the entire page.
-
#dest_fit_horizontally(top, dest_page = page) ⇒ Array(PDF::Core::Reference, :FitH, Numeric)
private
Builds a Dest specification that will fit the given page horizontally into the viewport, aligned vertically at the given top coordinate.
-
#dest_fit_rect(left, bottom, right, top, dest_page = page) ⇒ Array(Hash, :FitR, Numeric, Numeric, Numeric, Numeric)
private
Builds a Dest specification that will fit the given rectangle into the viewport, for the given page.
-
#dest_fit_vertically(left, dest_page = page) ⇒ Array(Hash, :FitV, Numeric)
private
Build a Dest specification that will fit the given page vertically into the viewport, aligned horizontally at the given left coordinate.
-
#dest_xyz(left, top, zoom = nil, dest_page = page) ⇒ Array(PDF::Core::Reference, :XYZ, Numeric, Numeric, [Numeric, null])
private
Builds a Dest specification for a specific location (and optional zoom level).
-
#dests ⇒ PDF::Core::Reference<PDF::Core::NameTree::Node>
private
The
:Dests
name tree in the Name dictionary.
Instance Method Details
#add_dest(name, reference) ⇒ void
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.
This method returns an undefined value.
Adds a new destination to the Dests name tree.
Source Code
35 | def add_dest(name, reference) |
36 | reference = ref!(reference) unless reference.is_a?(PDF::Core::Reference) |
37 | dests.data.add(name, reference) |
38 | end
|
#dest_fit(dest_page = page) ⇒ Array(PDF::Core::Reference, :Fit)
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.
builds a Dest specification that will fit the given page into the viewport.
Source Code
59 | def dest_fit(dest_page = page) |
60 | [dest_page.dictionary, :Fit] |
61 | end
|
#dest_fit_bounds(dest_page = page) ⇒ Array(PDF::Core::Reference, :FitB)
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.
Builds a Dest specification that will fit the given page’s bounding box into the viewport.
Source Code
106 | def dest_fit_bounds(dest_page = page) |
107 | [dest_page.dictionary, :FitB] |
108 | end
|
#dest_fit_bounds_horizontally(top, dest_page = page) ⇒ Array(PDF::Core::Reference, :FitBH, Numeric)
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.
Same as #dest_fit_horizontally, but works on the page’s bounding box instead of the entire page.
Source Code
117 | def dest_fit_bounds_horizontally(top, dest_page = page) |
118 | [dest_page.dictionary, :FitBH, top] |
119 | end
|
#dest_fit_bounds_vertically(left, dest_page = page) ⇒ Array(PDF::Core::Reference, :FitBV, Numeric)
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.
Same as #dest_fit_vertically, but works on the page’s bounding box instead of the entire page.
Source Code
128 | def dest_fit_bounds_vertically(left, dest_page = page) |
129 | [dest_page.dictionary, :FitBV, left] |
130 | end
|
#dest_fit_horizontally(top, dest_page = page) ⇒ Array(PDF::Core::Reference, :FitH, Numeric)
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.
Builds a Dest specification that will fit the given page horizontally into the viewport, aligned vertically at the given top coordinate.
Source Code
70 | def dest_fit_horizontally(top, dest_page = page) |
71 | [dest_page.dictionary, :FitH, top] |
72 | end
|
#dest_fit_rect(left, bottom, right, top, dest_page = page) ⇒ Array(Hash, :FitR, Numeric, Numeric, Numeric, Numeric)
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.
Builds a Dest specification that will fit the given rectangle into the viewport, for the given page.
Source Code
96 | def dest_fit_rect(left, bottom, right, top, dest_page = page) |
97 | [dest_page.dictionary, :FitR, left, bottom, right, top] |
98 | end
|
#dest_fit_vertically(left, dest_page = page) ⇒ Array(Hash, :FitV, Numeric)
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.
Build a Dest specification that will fit the given page vertically into the viewport, aligned horizontally at the given left coordinate.
Source Code
81 | def dest_fit_vertically(left, dest_page = page) |
82 | [dest_page.dictionary, :FitV, left] |
83 | end
|
#dest_xyz(left, top, zoom = nil, dest_page = page) ⇒ Array(PDF::Core::Reference, :XYZ, Numeric, Numeric, [Numeric, null])
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.
Builds a Dest specification for a specific location (and optional zoom level).
Source Code
49 | def dest_xyz(left, top, zoom = nil, dest_page = page) |
50 | [dest_page.dictionary, :XYZ, left, top, zoom] |
51 | end
|
#dests ⇒ PDF::Core::Reference<PDF::Core::NameTree::Node>
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.
The :Dests
name tree in the Name dictionary. This name tree is used to
store named destinations (PDF 1.7 spec 8.2.1). (For more on name trees,
see section 3.8.5 in the PDF 1.7 spec.)
Source Code
21 | def dests |
22 | names.data[:Dests] ||= ref!( |
23 | PDF::Core::NameTree::Node.new(self, NAME_TREE_CHILDREN_LIMIT), |
24 | )
|
25 | end
|