Hi!
i'm writing a web app that load an svg file and send it to a web client
with some transformation. there is two servlets :
- one to load and transform the SVGDocument and write it in the disk as a
temp file
- one to load the temp svg file and return it to the client
I'm using the svgTranscoder to write the temp file. the svg files can be
compressed in a svgz format. so i'm trying to use it. My first idea is to
produce a gzip temp file like that :
[code]
SVGTranscoder trans = new SVGTranscoder();
trans.addTranscodingHint(SVGTranscoder.KEY_XML_DECLARATION,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
trans.addTranscodingHint(SVGTranscoder.KEY_DOCTYPE,
SVGTranscoder.VALUE_DOCTYPE_CHANGE);
trans.addTranscodingHint(SVGTranscoder.KEY_FORMAT,
SVGTranscoder.VALUE_FORMAT_OFF);
TranscoderInput input = new
TranscoderInput(theTransformedSVGDocument);
GZIPOutputStream gz = new GZIPOutputStream(new
FileOutputStream(tempFile));
TranscoderOutput output = new TranscoderOutput(gz);
try {
trans.transcode(input,output);
} catch (TranscoderException ex) {
ex.printStackTrace();
}
[/code]
The type tempfile is File.
When executing this code i have an exception :
java.lang.Error: Writer expected
org.apache.batik.transcoder.svg2svg.SVGTranscoder.transcode(Unknown
Source)
The TranscoderOutPut can be either an OutputStream or an outPutStreamWriter.
can you help me? thank you!
--
View this message in context:
http://www.nabble.com/use-the-SVGTranscoder-with-GzipOutPutStream--tf4689465.html#a13402722
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]