Hi Ashish,
I don't know how you would get different results from the rasterizer and calling the transcoder the way you show for the same SVG file. because of the way dpi works it might not have the same effect on all content.
Ashish Kheterpal wrote:
Hi,
I have a SVG file that I am rasterizing to a JPG file by using the “Rasterizing” app at a higher resolution of 150 dpi.
/ Java –jar batik-rasterizer.jar –q 0.99 –dpi 150 xyz.svg /
* HOWEVER * , when I try to achieve the same effect using Transcoding hints in my program the resolution hint does not take affect and the JPEG image turns out to have a lower resolution. Here is the code…..
/ JPEGTranscoder t = new JPEGTranscoder (); /
/ // set the transcoding hints /
/ /
/ t.addTranscodingHint (JPEGTranscoder. // KEY // _MEDIA, "image/jpeg"); /
/ t.addTranscodingHint (JPEGTranscoder. // KEY // _QUALITY, new Float (0.99f)); /
/ t.addTranscodingHint (JPEGTranscoder. // KEY // _PIXEL_ // UNIT // _TO_MILLIMETER, new Float (0.1693f)); /
/ /
/ String svgURI = new File (“xyz.svg”).toURL().toString(); /
/ TranscoderInput input = new TranscoderInput (svgURI); /
/ /
/ OutputStream ostream = new FileOutputStream (“xyz.jpg”); /
/ TranscoderOutput output = new TranscoderOutput (ostream); /
/ /
/ // save the image /
/ t.transcode (input, output); /
/ /
/ // flush and close the stream then exit /
/ ostream.flush (); /
/ ostream.close (); /
Any help will be much appreciated!!
Thanks,
/ Ashish // Kheterpal /
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
