--- In [email protected], Thomas DeWeese <thomas.
[EMAIL PROTECTED]> wrote:
> Hi Alex,
> 
>     Sure check out:  http://xml.apache.org/batik/svggen.html
> 
>     It gives an overview of the SVGGraphics2D with sample code.

Thnx a lot. Now I know that i will use batik only for create pdf or 
image files and code the rest manually because I dont use in a
servlet 
the graphic classes (e.g. drawrect). Perhaps I could use the DOM
Model 
for my Project but the output stream of a servlet seems to be the 
better solution(e.g. below).

<DOM BATIK example>
// set the width and height attribute on the root svg element
svgRoot.setAttributeNS(null, "width", "400");
svgRoot.setAttributeNS(null, "height", "450");

// create the rectangle
Element rectangle = doc.createElementNS(svgNS, "rect");
rectangle.setAttributeNS(null, "x", "10");
rectangle.setAttributeNS(null, "y", "20");
rectangle.setAttributeNS(null, "width", "100");
rectangle.setAttributeNS(null, "height", "50");
rectangle.setAttributeNS(null, "style", "fill:red");

// attach the rectangle to the svg root element
svgRoot.appendChild(rectangle);
</DOM BATIK example>

<OUTPUT STREAM SERVLET>
PrintWriter out = response.getWriter();
out.println("<svg width=\"400\" height=\"450\">
    <rect x=\"10\" y=\"20\" width=\"100\" height=\"50\" style=\"fill:
red\"/>
</svg>");
</OUTPUT STREAM SERVLET>





-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to