Hello,
We've built a simple servlet to transform SVG to JPG using the Transcoder API. Please see below the code we're using:
private static final String CONTENT_TYPE = "image/jpeg; charset=UTF-8";
<....>
response.setContentType(CONTENT_TYPE);
//create a image transcoder
JPEGTranscoder t = new JPEGTranscoder();
// set the transcoding hints in case of jpeg image
t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(1.0));
// create the transcoder input
TranscoderInput input = new TranscoderInput(new StringReader(svgCompleted));
ServletOutputStream out = response.getOutputStream();
TranscoderOutput output = new TranscoderOutput(out);
t.transcode(input, output);
// flush (make memory empty) and close the stream
out.flush();
out.close();
<....>
It works very well with all kind of characters but for Arabic characters it does not display correctly.
The first character on the left is displayed well above the others.
Is this a known issue?
Does a better algorythm exist?
Thanks,
Thomas.
We've built a simple servlet to transform SVG to JPG using the Transcoder API. Please see below the code we're using:
private static final String CONTENT_TYPE = "image/jpeg; charset=UTF-8";
<....>
response.setContentType(CONTENT_TYPE);
//create a image transcoder
JPEGTranscoder t = new JPEGTranscoder();
// set the transcoding hints in case of jpeg image
t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(1.0));
// create the transcoder input
TranscoderInput input = new TranscoderInput(new StringReader(svgCompleted));
ServletOutputStream out = response.getOutputStream();
TranscoderOutput output = new TranscoderOutput(out);
t.transcode(input, output);
// flush (make memory empty) and close the stream
out.flush();
out.close();
<....>
It works very well with all kind of characters but for Arabic characters it does not display correctly.
The first character on the left is displayed well above the others.
Is this a known issue?
Does a better algorythm exist?
Thanks,
Thomas.
