xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Whittington" <Kevin.Whitting...@catalinamarketing.com>
Subject Transcoder Not Transcoding Xlinked Images
Date Thu, 11 Aug 2005 16:17:27 GMT
I'm currently new at Batik and have been trying to transcode SVG
fragments into JPEG images.  Using the SaveAsJPEG program found on the
Apache site as a guide, I found that SVG files that include other images
via the image tag are not included in the JPEG image.

For example...

Consider this simple SVG document:

<?xml version="1.0" standalone="no"?>

<svg width="655" height="600" viewBox="0 0 655 600"
     xmlns="http://www.w3.org/2000/svg" 
     xmlns:xlink="http://www.w3.org/1999/xlink" >
     <image x="25" y="315" width="360" height="240"
             xlink:href="/testsvg/shapes.svg"/>
</svg>

When executing the following code you get a JPEG that does not include
the image found in the shapes.svg file.

	// create the transcoder input
        	Reader reader = new FileReader(inFile);
        	TranscoderInput input = new TranscoderInput(reader);
        
        	// create the transcoder output
        	OutputStream ostream = new FileOutputStream(outFile);
        	TranscoderOutput output = new TranscoderOutput(ostream);
        
        	// save the image
        	transcoder.transcode(input, output);
        	
       	// flush and close the stream then exit
        	ostream.flush();
        	ostream.close();

However, I ran the same document through the rasterizer and the jpeg
generated did include the "included" image.  This would indicate to me
that I have not correctly utilized Batik for the transcoding.  Could
someone please provide some guidance in this issue?

Thanks!

Kevin Whittington

Mime
View raw message