You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-21Lines changed: 25 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This will take an SVG document as input and render it into your PDF. Find out m
10
10
http://github.com/prawnpdf/prawn
11
11
12
12
prawn-svg is compatible with all versions of Prawn from 0.11.1 onwards, including the 1.x and 2.x series.
13
-
The minimum Ruby version required is 2.3.0.
13
+
The minimum Ruby version required is 2.5.0.
14
14
15
15
## Using prawn-svg
16
16
@@ -33,7 +33,7 @@ Option | Data type | Description
33
33
:enable_web_requests | boolean | If true, prawn-svg will make http and https requests to fetch images. Defaults to true.
34
34
:enable_file_requests_with_root | string | If not nil, prawn-svg will serve `file:` URLs from your local disk if the file is located under the specified directory. It is very dangerous to specify the root path ("/") if you're not fully in control of your input SVG. Defaults to `nil` (off).
35
35
:cache_images | boolean | If true, prawn-svg will cache the result of all URL requests. Defaults to false.
36
-
:fallback_font_name | string | A font name which will override the default fallback font of Times-Roman. If this value is set to <tt>nil</tt>, prawn-svg will ignore a request for an unknown font and log a warning.
36
+
:fallback_font_name | string | A font name which will override the default fallback font of Times-Roman. If this value is set to `nil`, prawn-svg will ignore a request for an unknown font and log a warning.
37
37
:color_mode | :rgb, :cmyk | Output color mode. Defaults to :rgb.
38
38
39
39
## Examples
@@ -54,31 +54,33 @@ Option | Data type | Description
54
54
55
55
prawn-svg supports most but not all of the full SVG 1.1 specification. It currently supports:
56
56
57
-
-<tt><line></tt>, <tt><polyline></tt>, <tt><polygon></tt>, <tt><circle></tt> and <tt><ellipse></tt>
57
+
-`<line>`, `<polyline>`, `<polygon>`, `<circle>` and `<ellipse>`
58
58
59
-
-<tt><rect></tt>. Rounded rects are supported, but only one radius is applied to all corners.
59
+
-`<rect>`. Rounded rects are supported, but only one radius is applied to all corners.
60
60
61
-
-<tt><path></tt> supports all commands defined in SVG 1.1, although the
61
+
-`<path>` supports all commands defined in SVG 1.1, although the
62
62
implementation of elliptical arc is a bit rough at the moment.
63
63
64
-
-`<text>`, `<tspan>` and `<tref>` with attributes `x`, `y`, `dx`, `dy`, `rotate`, 'textLength', 'lengthAdjust', and with extra properties
-<tt><svg></tt>, <tt><g></tt> and <tt><symbol></tt>
68
+
-`<svg>`, `<g>` and `<symbol>`
68
69
69
-
-<tt><use></tt>
70
+
-`<use>`
70
71
71
-
-<tt><style></tt> (see CSS section below)
72
+
-`<style>` (see CSS section below)
72
73
73
74
-`<image>` referencing a JPEG, PNG, or SVG image, with `http:`, `https:`, `data:image/jpeg;base64`,
74
75
`data:image/png;base64`, `data:image/svg+xml;base64` and `file:` schemes (`file:` is disabled by default for
75
76
security reasons, see Options section above)
76
77
77
-
-<tt><clipPath></tt>
78
+
-`<clipPath>`
78
79
79
80
-`<marker>`
80
81
81
-
-`<linearGradient>` and `<radialGradient>` are implemented on Prawn 2.2.0+ with attributes `gradientUnits` and `gradientTransform` (spreadMethod and stop-opacity are unimplemented.)
82
+
-`<linearGradient>` and `<radialGradient>` are implemented on Prawn 2.2.0+ with attributes `gradientUnits` and
83
+
`gradientTransform` (`spreadMethod` and `stop-opacity` are unimplemented.)
82
84
83
85
-`<switch>` and `<foreignObject>`, although prawn-svg cannot handle any data that is not SVG so `<foreignObject>`
84
86
tags are always ignored.
@@ -90,18 +92,19 @@ prawn-svg supports most but not all of the full SVG 1.1 specification. It curre
90
92
91
93
- attributes on all elements: `class`, `id`, `style`, `transform`, `xml:space`
92
94
93
-
- the <tt>viewBox</tt> attribute on <tt><svg></tt> and `<marker>` elements
95
+
- the `viewBox` attribute on `<svg>` and `<marker>` elements
94
96
95
-
- the <tt>preserveAspectRatio</tt> attribute on <tt><svg></tt>, <tt><image></tt> and `<marker>` elements
97
+
- the `preserveAspectRatio` attribute on `<svg>`, `<image>` and `<marker>` elements
- fonts: generic CSS fonts, built-in PDF fonts, and any TTF fonts in your fonts path, specified in any of the measurements above plus `em` or `rem`
106
+
- fonts: generic CSS fonts, built-in PDF fonts, and any TTF fonts in your fonts path, specified in any of the
107
+
measurements above plus `em` or `rem`
105
108
106
109
## CSS
107
110
@@ -128,8 +131,9 @@ It does not support text in the clip area, but you can clip shapes and text by a
128
131
129
132
### Fonts
130
133
131
-
By default, prawn-svg has a fonts path of <tt>["/Library/Fonts", "/System/Library/Fonts", "#{ENV["HOME"]}/Library/Fonts", "/usr/share/fonts/truetype"]</tt> to catch
132
-
Mac OS X and Debian Linux users. You can add to the font path:
134
+
By default, prawn-svg has a fonts path of `["/Library/Fonts", "/System/Library/Fonts",
135
+
"#{ENV["HOME"]}/Library/Fonts", "/usr/share/fonts/truetype"]` to catch MacOS and Debian Linux users. You can add
0 commit comments