Sha256: e81786eff682f028ceb2b2c67713a6c69bb7c84906b713aaebedf227fc000acb

Contents?: true

Size: 774 Bytes

Versions: 9

Compression:

Stored size: 774 Bytes

Contents

module Prawn
  module Svg
    module Extension
      #
      # 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::Interface.new(data, self, options)
        svg.draw
        {:warnings => svg.document.warnings, :width => svg.document.width, :height => svg.document.height}
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
prawn-svg-0.15.0.0 lib/prawn/svg/extension.rb
prawn-svg-0.12.0.12 lib/prawn/svg/extension.rb
prawn-svg-0.12.0.11 lib/prawn/svg/extension.rb
prawn-svg-0.12.0.10 lib/prawn/svg/extension.rb
prawn-svg-0.12.0.9 lib/prawn/svg/extension.rb
prawn-svg-0.12.0.8 lib/prawn/svg/extension.rb
prawn-svg-0.12.0.7 lib/prawn/svg/extension.rb
prawn-svg-0.12.0.6 lib/prawn/svg/extension.rb
prawn-svg-0.12.0.4 lib/prawn/svg/extension.rb