Access Keys:
Skip to content (Access Key - 0)

svgmate is a java web application which uses the batik svg toolkit to generate images from svg files.

Currently only the PNG format is supported. But since batik supports more svgmate may also support other formats in the future.

The web application can be tested here. On this page you can upload a SVG file and will receive a PNG file. Behind the scenes is a servlet to which an SVG file can be posted.

Beside the POST method it supports the GET method.
With GET the content of a SVG file can be defined using request parameters. The parameter value is embedded in an <svg> element and then converted.
E.g. the url
http://tomcat.banapple.de/svgmate/svgmate?content=%3Crect%20x=%220%22%20y=%220%22%20width=%2299%22%20height=%2299%22%20fill=%22red%22%20stroke=%22black%22/%3E%3Ctext%20x=%2220%22%20y=%2280%22%20transform=%22rotate(-60,20,80)%22%3EThis%20is%20the%20text%3C/text%3E&width=100&height=100
produces the image

The source code is available via anonymous svn:

# svn co http://subversion.banapple.de/public/svgmate/

The web application can then be build with maven:

# mvn package

You may try the application with the file http://subversion.banapple.de/public/svgmate/src/test/resources/rotated_text.svg:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200"
  xmlns:xlink="http://www.w3.org/1999/xlink">
<title>rotated text</title>
<desc>an example of a rotated text</desc>

<text x="20" y="180"
	font-family="verdana" font-size="16px"
	transform="rotate(-60,20,180)">
This is the rotated text
</text>
</svg>

An application of the servlet is the vbox user macro, a confluence user macro which generates vertical text.

Please leave a comment for bugs or suggestions.

del.icio.us digg Mister Wong YahooMyWeb Reddit Furl Spurl blogmarks

Adaptavist Theme Builder (3.3.5-conf210) Powered by Atlassian Confluence 3.0.2, the Enterprise Wiki.