Class: Prawn::SVG::LinkRenderer

Inherits:
Object
  • Object
show all
Includes:
PDFMatrix
Defined in:
lib/prawn/svg/link_renderer.rb

Instance Method Summary collapse

Methods included from PDFMatrix

#load_matrix, #matrix_for_pdf, #rotation_matrix, #scale_matrix, #translation_matrix

Constructor Details

#initialize(href, bounding_box) ⇒ LinkRenderer

Returns a new instance of LinkRenderer.



4
5
6
7
# File 'lib/prawn/svg/link_renderer.rb', line 4

def initialize(href, bounding_box)
  @href = href
  @bounding_box = bounding_box
end

Instance Method Details

#render(prawn) ⇒ Object



9
10
11
12
13
14
# File 'lib/prawn/svg/link_renderer.rb', line 9

def render(prawn)
  prawn.link_annotation(transformed_bounding_box(prawn), {
    Border: [0, 0, 0],
    A:      { Type: :Action, S: :URI, URI: PDF::Core::LiteralString.new(href) }
  })
end