prawn-svg 0.9.1.6 → 0.9.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/prawn-svg.rb +5 -3
- data/lib/prawn/svg/extension.rb +24 -0
- data/lib/prawn/svg/interface.rb +87 -0
- data/lib/prawn/svg/parser.rb +368 -362
- data/lib/prawn/svg/parser/path.rb +184 -0
- metadata +6 -6
- data/lib/prawn/svg/path.rb +0 -180
- data/lib/prawn/svg/svg.rb +0 -83
- data/lib/prawn/svg_document.rb +0 -22
data/lib/prawn/svg_document.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
module Prawn
|
2
|
-
class Document
|
3
|
-
#
|
4
|
-
# Draws an SVG document into the PDF.
|
5
|
-
#
|
6
|
-
# +options+ must contain the key :at, which takes a tuple of x and y co-ordinates.
|
7
|
-
#
|
8
|
-
# +options+ can optionally contain the key :width or :height. If both are
|
9
|
-
# specified, only :width will be used. If neither are specified, the resolution
|
10
|
-
# given in the SVG will be used.
|
11
|
-
#
|
12
|
-
# Example usage:
|
13
|
-
#
|
14
|
-
# svg IO.read("example.svg"), :at => [100, 300], :width => 600
|
15
|
-
#
|
16
|
-
def svg(data, options={})
|
17
|
-
svg = Prawn::Svg.new(data, self, options)
|
18
|
-
svg.draw
|
19
|
-
{:warnings => svg.parser_warnings, :width => svg.parser.width, :height => svg.parser.height}
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|