opensubscriber
   Find in this group all groups
 
Unknown more information…

b : batik-users@xmlgraphics.apache.org 31 August 2009 • 5:26PM -0400

Removing DOCTYPE in the SVG XML
by ninitha

REPLY TO AUTHOR
 
REPLY TO GROUP





Hi,

        I am converting jFreeCharts to SVG. When I load in one of the XSL FO
Processor(Render X XEP), it throws time out error at the line <!DOCTYPE svg
PUBLIC '-//W3C//DTD SVG 1.0//EN'
          'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
If the line is removed, the XSL FO is processed and converted to PDF. So is
there a way to remove the line in the resulting SVG XML before saving the
file.Following is the code used to get the SVG file.

DOMImplementation dom = GenericDOMImplementation.getDOMImplementation();
Document document =
dom.createDocument(SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", null);

SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);
ctx.setEmbeddedFontsOn(false);
boolean textAsShapes = false;

SVGGraphics2D g2 = new SVGGraphics2D(ctx, textAsShapes);
g2.setSVGCanvasSize(new java.awt.Dimension(height,width));
        
// tell JFreeChart to draw itself into the SVG
chart.draw(g2, new Rectangle(0, 0, height,width), null);

// Write svg file
        OutputStream outputStream = new FileOutputStream(svgFileName);
        Writer out = new OutputStreamWriter(outputStream, "UTF-8");
        g2.stream(out, true);
        outputStream.flush();
        outputStream.close();

Please do let me know as soon as possible
--
View this message in context: http://www.nabble.com/Removing-DOCTYPE-in-the-SVG-XML-tp25220586p25220586.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlg...
For additional commands, e-mail: batik-users-help@xmlg...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.