Hi there, I'm trying to use batik to transform an SVG file into a PNG file using PNGTransform. I get out a PNG file but it has no text elements. Everything else seems to get rendered.
The code is being executed inside an Oracle server's JVM. I've attached the
input SVG file and the output that batik produces. The class I'm using is
below. I'm not sure where to begin looking for a problem in the batik sources.
Any pointers would be most helpful.
Thanks,
Robert Ham
package org.bristol.cyps.svg;
import java.lang.Float;
import oracle.sql.CLOB;
import oracle.sql.BLOB;
import org.apache.batik.transcoder.SVGAbstractTranscoder;
import org.apache.batik.transcoder.image.PNGTranscoder;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
public class Convert
{
public static void svgToPng(CLOB svg[], BLOB png[], Float width, Float height)
throws java.sql.SQLException,
org.apache.batik.transcoder.TranscoderException
{
TranscoderInput input = new TranscoderInput(svg[0].getAsciiStream());
TranscoderOutput output = new
TranscoderOutput(png[0].getBinaryOutputStream());
PNGTranscoder transcoder = new PNGTranscoder();
if (width.floatValue() > 0.0)
{
transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_WIDTH, width);
}
if (height.floatValue() > 0.0)
{
transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_HEIGHT, height);
}
transcoder.transcode(input, output);
}
}
--
[EMAIL PROTECTED]
0117 92 22494
Analyst Programmer
Children and Young People's Services IT
Bristol City Council
______________________________________________________________________
Please note the new simpler name for our website: http://www.bristol.gov.uk
Our email addresses have also changed - visit
http://www.bristol.gov.uk/bigchange for further details.
Sign-up for our email bulletin giving news, have-your-say and event
information at: http://www.bristol.gov.uk/newsdirect
analysis-chart.svg
Description: Binary data
<<attachment: analysis-chart.png>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
