Hello I have an svg file generated by Adobe Illustrator. If I render with Batik or Firefox it's ok, if I render in java application to generate png or jpeg image i get extra borders to some figures like in this example.

avoid extra borders

Is possible to avoid this with some transcoding hints or some other workaround ?
this is my code:
PNGTranscoder t = new PNGTranscoder();
t.addTranscodingHint(PNGTranscoder.KEY_INDEXED, new Integer(5));
t.addTranscodingHint(PNGTranscoder.KEY_XML_PARSER_VALIDATING, new Boolean(false));

SVGGraphics2D svgGenerator = new SVGGraphics2D(mapDoc);

Element root = mapDoc.getDocumentElement();
svgGenerator.getRoot(root);
svgGenerator = null;

TranscoderInput input = new TranscoderInput(mapDoc);

// set the transcoding hints
Rectangle r = new Rectangle((int)(offsetX), (int)(offsetY), (int)(imageWidth), (int)(imageHeight));

t.addTranscodingHint(ImageTranscoder.KEY_AOI, r);
t.addTranscodingHint(ImageTranscoder.KEY_WIDTH, new Float(imageWidth));
t.addTranscodingHint(ImageTranscoder.KEY_HEIGHT, new Float(imageHeight));

TranscoderOutput output = new TranscoderOutput(response.getOutputStream());

t.transcode(input, output);

Thank You for any help

View this message in context: avoid extra borders
Sent from the Batik - Users forum at Nabble.com.

Reply via email to