thomas.deweese wrote:
>
> Hi Frank,
>
> uetac <[EMAIL PROTECTED]> wrote on 10/25/2007 05:05:26 AM:
>
>> 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 :
>>
>> GZIPOutputStream gz = new GZIPOutputStream(new
>> FileOutputStream(tempFile));
>> TranscoderOutput output = new TranscoderOutput(gz);
>
>> 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)
>
> This should be easy enough to fix by simply wrapping the
> GZIPOutputStream
> with a java.io.OutputStreamWriter and pass that to the TranscoderOutput
> constructor.
>
ok, i have done it :
[code]
GZIPOutputStream gz = new GZIPOutputStream(new
FileOutputStream(tempFile));
// TranscoderOutput output = new TranscoderOutput(new
OutputStreamWriter(new FileOutputStream(tempFile), "UTF-8"));
TranscoderOutput output = new TranscoderOutput(new
OutputStreamWriter(gz,
"UTF-8"));
try {
trans.transcode(input, output);
} catch (TranscoderException ex) {
ex.printStackTrace();
}
[/code]
it's compiling but the svgz file is empty. may i use the wrapper
incorrectly?
thank you
i have found something to help me but not to give a solution of that. My
servlet generates real svg files
and when the second servlet is called to send the svg file to the web
client, i "gzip" the outputsteam of the HttpServletResponse. it works.
--
View this message in context:
http://www.nabble.com/use-the-SVGTranscoder-with-GzipOutPutStream--tf4689465.html#a13409164
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]