forked from mogest/prawn-svg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
57 lines (35 loc) · 1.86 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
An SVG renderer for the Prawn PDF library.
This will take an SVG file as input and render it into your PDF. Find out more about the Prawn PDF library at:
http://wiki.github.com/sandal/prawn/
Using prawn-svg:
Prawn::Document.generate("svg.pdf") do
svg svg_data, :at => [x, y], :width => w
end
:at must be specified. :width, :height, or neither may be specified; if neither is present,
the resolution specified in the SVG will be used.
prawn-svg is in its infancy and does not support the full SVG specifications. It currently supports:
- line tag
- polyline tag
- polygon tag
- circle tag
- ellipse tag (although this seems to be buggy)
- rect tag
supports rounded rects, but only one radius is applied to all corners
- path tag
supports moveto, closepath, lineto, horiz lineto, vert lineto, curveto, smooth curveto, quad curveto, smooth quad curveto
does not support elliptical arc
- text and tspan tags
attributes: size, text-anchor, font-family, font-weight, dx, dy
- svg, g and symbol tags
- use tag
- style tag, if css_parser gem is installed on the system [1]
- attributes/styles: fill, stroke, stroke-width, opacity, fill-opacity, stroke-opacity, transform
- transform methods: translate, rotate, scale, matrix
- colors: html standard names, #xxx, #xxxxxx, rgb(1, 2, 3), rgb(1%, 2%, 3%)
- measurements specified in pt, cm, dm, ft, in, m, mm, yd, %
- fonts: generic CSS fonts, built in PDF fonts, and any TTF fonts in your fonts path
By default, prawn-svg has a fonts path of ["/Library/Fonts", "/usr/share/fonts/truetype/**"] to catch
Mac OS X and Debian Linux users. You can add to the font path:
Prawn::Svg.font_path << "/my/font/directory"
prawn-svg does NOT support external references, gradients/patterns or markers.
[1] If the css_parser gem is installed, it will handle CSS style definitions, but only simple tag, class or id definitions.