Closed touchmii closed 2 years ago
This would be better in Discussions.
Anyway, setting the id for an element is supported. Since JFreeSVG targets the Graphics2D API, it makes use of the rendering hints facility (slightly non-obvious, but it has the advantage that your code will still run against other Graphics2D implementations - the hints get ignored, but otherwise the rendering is the same). You can do something like this:
Graphics2D g2 = ... (from wherever you create your Graphics2D instance)
g2.setRenderingHint(SVGHints.KEY_ELEMENT_ID, "XYZ");
g2.fill(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
...and then the rectangle in the SVG output will be tagged with the specified element ID.
like this, can help web identify element name.