### Home Classes Methods

### In Files

- lib/prawn/document/destinations.rb

### Methods

- #add_dest
- #dest_fit
- #dest_fit_bounds
- #dest_fit_bounds_horizontally
- #dest_fit_bounds_vertically
- #dest_fit_horizontally
- #dest_fit_rect
- #dest_fit_vertically
- #dest_xyz
- #dests

### Files

- COPYING
- HACKING
- LICENSE
- README

### Class/Module Index

Quicksearch

- Prawn
- Prawn::Core
- Prawn::Document
- Prawn::Document::Annotations
- Prawn::Document::BoundingBox
- Prawn::Document::ColumnBox
- Prawn::Document::Destinations
- Prawn::Document::GraphicsState
- Prawn::Document::Internals
- Prawn::Document::PageGeometry
- Prawn::Document::Snapshot
- Prawn::Encoding
- Prawn::Errors
- Prawn::Font
- Prawn::Font::AFM
- Prawn::Font::DFont
- Prawn::Font::TTF
- Prawn::Graphics
- Prawn::Graphics::CapStyle
- Prawn::Graphics::Color
- Prawn::Graphics::Dash
- Prawn::Graphics::JoinStyle
- Prawn::Graphics::Transformation
- Prawn::Graphics::Transparency
- Prawn::Images
- Prawn::Images::JPG
- Prawn::Images::PNG
- Prawn::Measurements
- Prawn::Outline
- Prawn::Stamp
- Prawn::Text
- Prawn::Text::Box
- Prawn::Text::LineWrap
- File
- Numeric

No matching classes.

# Prawn::Document::Destinations

### Public Instance Methods

add_dest(name, reference) click to toggle source

Adds a new destination to the dests name tree (see dests). The `reference` parameter will be converted into a Prawn::Reference if it is not already one.

    # File lib/prawn/document/destinations.rb, line 29
    def add_dest(name, reference)
      reference = ref!(reference) unless reference.is_a?(Prawn::Reference)
      dests.data.add(name, reference)
    end

dest_fit(page=current_page) click to toggle source

Return a Dest specification that will fit the given page into the viewport.

    # File lib/prawn/document/destinations.rb, line 44
    def dest_fit(page=current_page)
      [page, :Fit]
    end

dest_fit_bounds(page=current_page) click to toggle source

Return a Dest specfication that will fit the given page's bounding box into the viewport.

    # File lib/prawn/document/destinations.rb, line 72
    def dest_fit_bounds(page=current_page)
      [page, :FitB]
    end

dest_fit_bounds_horizontally(top, page=current_page) click to toggle source

Same as dest_fit_horizontally, but works on the page's bounding box instead of the entire page.

    # File lib/prawn/document/destinations.rb, line 79
    def dest_fit_bounds_horizontally(top, page=current_page)
      [page, :FitBH, top]
    end

dest_fit_bounds_vertically(left, page=current_page) click to toggle source

Same as dest_fit_vertically, but works on the page's bounding box instead of the entire page.

    # File lib/prawn/document/destinations.rb, line 86
    def dest_fit_bounds_vertically(left, page=current_page)
      [page, :FitBV, left]
    end

dest_fit_horizontally(top, page=current_page) click to toggle source

Return a Dest specification that will fit the given page horizontally into the viewport, aligned vertically at the given top coordinate.

    # File lib/prawn/document/destinations.rb, line 51
    def dest_fit_horizontally(top, page=current_page)
      [page, :FitH, top]
    end

dest_fit_rect(left, bottom, right, top, page=current_page) click to toggle source

Return a Dest specification that will fit the given rectangle into the viewport, for the given page.

    # File lib/prawn/document/destinations.rb, line 65
    def dest_fit_rect(left, bottom, right, top, page=current_page)
      [page, :FitR, left, bottom, right, top]
    end

dest_fit_vertically(left, page=current_page) click to toggle source

Return a Dest specification that will fit the given page vertically into the viewport, aligned horizontally at the given left coordinate.

    # File lib/prawn/document/destinations.rb, line 58
    def dest_fit_vertically(left, page=current_page)
      [page, :FitV, left]
    end

dest_xyz(left, top, zoom=nil, page=current_page) click to toggle source

Return a Dest specification for a specific location (and optional zoom level).

    # File lib/prawn/document/destinations.rb, line 37
    def dest_xyz(left, top, zoom=nil, page=current_page)
      [page, :XYZ, left, top, zoom]
    end

dests() click to toggle source

The Dests name tree in the Name dictionary (see Prawn::Document::Internal#names). This name tree is used to store named destinations (PDF spec 8.2.1). (For more on name trees, see section 3.8.4 in the PDF spec.)

    # File lib/prawn/document/destinations.rb, line 21
    def dests
      names.data[:Dests] ||= ref!(Prawn::NameTree::Node.new(self, NAME_TREE_CHILDREN_LIMIT))
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.