Hi, Thomas,
2006/7/6, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
"Nick Labadie" <[EMAIL PROTECTED]> wrote on 07/03/2006 07:46:27 PM:
> I want to output SVG Tiny documents with using Batik.
> Can Batik output SVG Tiny documents?
In what context? Any Java application can output
SVG Tiny using 'println' but I'm guessing this is
not what you have in mind ;)
I want output SVG Tiny document with using Batik.
Does Batik support SVG 1.1 and SVG Tiny?
Does Batik support modules of SVG 1.1?
sample code that I want
------------------------------------------------------------------------
import java.awt.*;
import java.awt.geom.*;
import java.io.*;
import org.w3c.dom.*;
import org.apache.batik.dom.*;
import org.apache.batik.svggen.*;
public class SVGTest {
public static void main(String[] args) throws Exception {
try {
// creating Graphics2D object
DOMImplementation domImpl
= GenericDOMImplementation.getDOMImplementation();
Document document = domImpl.createDocument(null, "svg", null);
SVGGraphics2D g = new SVGGraphics2D(document);
g.setSVGCanvasSize(new Dimension(500, 500));
// drawing graphics
// (Actually, I want draw more complex graphics...)
Line2D line = new Line2D.Double(0.0, 0.0, 10, 10);
g.draw(line);
// creating svg content string
StringWriter writer = new StringWriter();
g.stream(writer);
String svgContent = writer.toString();
g.dispose();
// output svg content
FileOutputStream fos = new FileOutputStream("svgtest.svg");
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
BufferedWriter bw = new BufferedWriter(osw);
bw.write(svgContent);
bw.flush();
bw.close();
} catch (Exception e) {
throw e;
}
}
}
------------------------------------------------------------------------
output SVG document
------------------------------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg fill-opacity="1" xmlns:xlink="http://www.w3.org/1999/xlink"
color-rendering="auto" color-interpolation="auto"
text-rendering="auto" stroke="black" stroke-linecap="square"
width="500" stroke-miterlimit="10" shape-rendering="auto"
stroke-opacity="1" fill="black" stroke-dasharray="none"
font-weight="normal" stroke-width="1" height="500"
xmlns="http://www.w3.org/2000/svg" font-family="'sansserif'"
font-style="normal" stroke-linejoin="miter" font-size="12"
stroke-dashoffset="0" image-rendering="auto">
<!--Generated by the Batik Graphics2D SVG Generator-->
<defs id="genericDefs" />
<g>
<g>
<line y2="10" fill="none" x1="0" x2="10" y1="0" />
</g>
</g>
</svg>
------------------------------------------------------------------------
I want that baseProfile="tiny" .
A baseProfile attribute of svg element has value, "tiny".
I seached Batik API for setup baseProfile. But I didn't find out it.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]