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