I am using the Batik API to convert an SVG image to JPEG. The SVG images
contains text of various fonts like Chinese. I want to scale the SVG image
to be 80% of its original size before converting to JPEG. I am assuming that
is is best to scale the SVG before conversion because JPEG does not scale
very well. However, the text in the resulting JPEG image seems to be skewed
or blurry. 

Please advise.

Michael

PS code is below

InputStream ins = new
ByteArrayInputStream(label.renderLabelContent().getBytes()); 
JPEGTranscoder t = new JPEGTranscoder();
t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(.97));
t.addTranscodingHint(JPEGTranscoder.KEY_EXECUTE_ONLOAD, new Boolean(true));
t.addTranscodingHint(JPEGTranscoder.KEY_CONSTRAIN_SCRIPT_ORIGIN, new
Boolean(false));
//here the image width is 750 -- mult by .8 gives 600
t.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, new Float(600.0));
TranscoderInput input = new TranscoderInput(ins);
OutputStream ostream = new FileOutputStream(svgFile.getFile());
TranscoderOutput output = new TranscoderOutput(ostream);
t.transcode(input, output);
ostream.flush();
ostream.close();

-- 
View this message in context: 
http://www.nabble.com/SVG-text-problem-when-converting-to-JPEG-tf2048326.html#a5641715
Sent from the Batik - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to