I do not know whether it´s the same case, but I had difficulty to the graphics object, due to user / device-space. Can you check whether you have minus values in the coordinates? regards max
2014-07-03 11:38 GMT+02:00, Lionel SPINELLI <spine...@ciml.univ-mrs.fr>: > Hello all, > > I am new to batik and I have a question regarding the svg image size. > I successfully create a SVG using batik (that's very simple, thanks for > developing such easy API) but when the image is opened in various > application (Linux Image viewer, Chrome, Firefox..), the image is "cut" on > the right and bottom sides. When opened in image editors like Illustrator, > the image is complete and correctly formed. > > Here is the code I used: > > String svgNS = "http://www.w3.org/2000/svg"; > Document document = domImpl.createDocument( svgNS, "svg", null); > SVGGraphics2D svgGenerator = new SVGGraphics2D( document); > paintTable( svgGenerator, table_ResultTable); > > The paintTable methods contains Graphics2D methods like g2d.drawString or > g2d.fillRect. > > I have tried to add code I found in the documentation like : > > Element svgRoot = document.getDocumentElement(); > svgRoot.setAttributeNS( null, "width", "400"); > svgRoot.setAttributeNS( null, "height", "400"); > > But without effect (the SVG XML code does not contain the width and height > attributes) > > How can I control the SVG image size so that it will be correctly opened in > all image viewer and browser? > > Thanks a lot in advance > > Lionel > > --------------------------------------------------------------------- > To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org