Sha256: 693e2a7eec2ee84cd03c8fbe1c47868d3d455e21c1cc4b6a1cbf0b716f815045

Contents?: true

Size: 639 Bytes

Versions: 3

Compression:

Stored size: 639 Bytes

Contents

module Prawn
  class Document
    #
    # Draws an SVG document into the PDF.
    #
    # +options+ must contain the key :at, which takes a tuple of x and y co-ordinates.
    #
    # +options+ can optionally contain the key :width or :height.  If both are 
    # specified, only :width will be used.  If neither are specified, the resolution
    # given in the SVG will be used.
    #
    # Example usage:
    #
    #   svg IO.read("example.svg"), :at => [100, 300], :width => 600
    #
    def svg(data, options={})
      svg = Prawn::Svg.new(data, self, options)
      svg.draw
      {:warnings => svg.parser_warnings}
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
prawn-svg-0.9.1.5 lib/prawn/svg_document.rb
prawn-svg-0.9.1.4 lib/prawn/svg_document.rb
prawn-svg-0.9.1.3 lib/prawn/svg_document.rb