xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randall Parker" <randa...@nls.net>
Subject Use SVGGraphics2D Document as TranscoderInput to JPEGTranscoder?
Date Thu, 23 Aug 2001 20:57:33 GMT
The goal I'm trying to achieve is to make up an SVG DOM tree by making a series of calls to

SVGGraphics2D. Then while the data for the image is still in the DOM tree (ie still in the

org.w3c.dom.Document) I'd like to give it to JPEGTranscoder. 

In other words, I'd like to avoid the overhead of streaming out the DOM tree. I'd like to
go directly to 
JPEG after making all the SVGGraphics2D calls. 

It looks like it might be possible to use the Document tree originally given to the constructor
of the 
SVGGraphics2D object as the input to the constructor for org.apache.batik.transcoder.TranscoderInput.

Then it seems like it ought to be possible to call  org.apache.batik.transcoder.image.JPEGTranscoder

object with that TranscoderInput object using the transcode method it inherits from:
   org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(TranscoderInput input, 
TranscoderOutput output)

First of all, is this supposed to be possible to do?

Secondly, do I need to perform any manipulation to the Document object before giving it to
TranscoderInput constructor?

I ask the second question because SVGGraphics2D.stream(Element svgRoot, Writer writer, boolean

useCss) adds an svgRoot to svgDocument before trying to stream it out. So I'm wondering whether

adding that would be a good or bad or indifferent thing to do before trying to generate a
JPEG from the 

To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

View raw message