JFreeSVG vs Batik

A discussion forum for JFreeSVG (a fast, lightweight, SVG generator for the Java platform).
Locked
trident777
Posts: 1
Joined: Fri May 24, 2019 12:58 am
antibot: No, of course not.

JFreeSVG vs Batik

Post by trident777 » Fri May 24, 2019 1:06 am

I started using Batik but I find it extremely difficult to use due to lack of documentation or any sort of information. Thinking of switching to JFreeSVG since on first look it seems simpler. Here is what I want to do:

1. Create a new blank SVG
2. Read a PNG and embed it into above SVG
3. Create new SVG elements (Polygons, Rectangles etc.)
4. Have full control on all attributes of created elements (id, class, custom attributes etc.)
5. Have full control on inserting embedded styles
6. Import some arbitrary SVG fragment and append those nodes at a certain point in the document

I have been able to create 1, 2, 3 in Batik. 4 does not seem to work at all in Batik despite trying various things. Elements created using SVGGraphics2D's draw methods seem to ignore all setAttributeNS methods while if I create those elements manually in the DOM I can set attributes, however in the latter case I don't even need an SVG library as I am just using the core XML document APIs.

Locked