Hi Mr. Patol, MrPatol <[EMAIL PROTECTED]> wrote on 07/12/2006 09:16:04 AM:
> 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. I would have to see the SVG document to know why it is stroking these elements. > Is possible to avoid this with some transcoding hints or some other workaround ? Since the Batik viewer gets it right I'm sure it can be fixed/worked around fairly easily but I'm having a hard time coming up with a really good reason why one would end up with a 'stroke' and the other doesn't (something with entities or default parameters is my best guess...). > 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. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
