1SVG(3) User Contributed Perl Documentation SVG(3)
2
3
4
6 SVG - Perl extension for generating Scalable Vector Graphics (SVG) doc‐
7 uments
8
9 VERSION
10
11 Version 2.44, 08 April, 2008
12
13 Refer to SVG::Manual for the complete manual
14
16 SVG is a 100% Perl module which generates a nested data structure con‐
17 taining the DOM representation of an SVG (Scalable Vector Graphics)
18 image. Using SVG, you can generate SVG objects, embed other SVG
19 instances into it, access the DOM object, create and access javascript,
20 and generate SMIL animation content.
21
22 Refer to SVG::Manual for the complete manual.
23
25 Ronan Oger, RO IT Systemms GmbH, cpan@roitsystems.com.com
26
28 I would like to thank the following people for contributing to this
29 module with patches, testing, suggestions, and other nice tidbits:
30 Peter Wainwright, Ian Hickson, Adam Schneider, Steve Lihn, Allen Day
31
33 http://www.roitsystems.com/index.shtml?svg.pod
34
36 perl(1),SVG,SVG::DOM,SVG::XML,SVG::Element,SVG::Parser, SVG::Manual
37 SVG::Extension <http://www.roitsystems.com/> ROASP.com: Serverside SVG
38 server <http://www.roitsystems.com/> ROIT Systems: Commercial SVG perl
39 solutions <http://www.w3c.org/Graphics/SVG/> SVG at the W3C
40
42 SVG provides both explicit and generic element constructor methods.
43 Explicit generators are generally (with a few exceptions) named for the
44 element they generate. If a tag method is required for a tag containing
45 hyphens, the method name replaces the hyphen with an underscore. ie: to
46 generate tag <column-heading id="new"> you would use method $svg->col‐
47 umn_heading(id=>'new').
48
49 All element constructors take a hash of element attributes and options;
50 element attributes such as 'id' or 'border' are passed by name, while
51 options for the method (such as the type of an element that supports
52 multiple alternate forms) are passed preceded by a hyphen, e.g '-type'.
53 Both types may be freely intermixed; see the "fe" method and code exam‐
54 ples througout the documentation for more examples.
55
56 new (constructor)
57
58 $svg = SVG->new(%attributes)
59
60 Creates a new SVG object. Attributes of the document SVG element be
61 passed as an optional list of key value pairs. Additionally, SVG
62 options (prefixed with a hyphen) may be set on a per object basis:
63
64 Example:
65
66 my $svg1=new SVG;
67
68 my $svg2=new SVG(id => 'document_element');
69
70 my $svg3=new SVG(
71 -printerror => 1,
72 -raiseerror => 0,
73 -indent => ' ',
74 -elsep =>"\n", # element line (vertical) separator
75 -docroot => 'svg', #default document root element (SVG specification assumes svg). Defaults to 'svg' if undefined
76
77 -xml_xlink => 'http://www.w3.org/1999/xlink', #required by Mozilla's embedded SVG engine
78 -sysid => 'abc', #optional system identifyer
79 -pubid => "-//W3C//DTD SVG 1.0//EN", #public identifyer default value is "-//W3C//DTD SVG 1.0//EN" if undefined
80 -namespace => 'mysvg',
81 -inline => 1
82 id => 'document_element',
83 width => 300,
84 height => 200,
85 );
86
87 Default SVG options may also be set in the import list. See "EXPORTS"
88 above for more on the available options.
89
90 Furthermore, the following options:
91
92 -version
93 -encoding
94 -standalone
95 -namespace
96 -inline
97 -pubid (formerly -identifier)
98 -sysid (standalone)
99
100 may also be set in xmlify, overriding any corresponding values set in
101 the SVG->new declaration
102
103 xmlify (alias: to_xml render serialize serialise )
104
105 $string = $svg->xmlify(%attributes);
106
107 Returns xml representation of svg document.
108
109 XML Declaration
110
111 Name Default Value
112 -version '1.0'
113 -encoding 'UTF-8'
114 -standalone 'yes'
115 -namespace 'svg' - namespace prefix for elements.
116 Can also be used in any element method to over-ride
117 the current namespace prefix. Make sure to have
118 declared the prefix before using it.
119 -inline '0' - If '1', then this is an inline document.
120 -pubid '-//W3C//DTD SVG 1.0//EN';
121 -sysid 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'
122
123 perlify ()
124
125 return the perl code which generates the SVG document as it currently
126 exists.
127
128 toperl ()
129
130 Alias for method perlify()
131
132
133
134perl v5.8.8 2008-04-21 SVG(3)