There are several reasons why EchoSVG is not a drop-in replacement for Apache Batik:
-
Avoid using Apache Software Foundation package names and trademarks.
-
Improved conformance to the SVG and CSS specifications.
-
Better user experience (e.g. the
codec
classes that got merged intotranscoder
, or the cleaner module interdependencies). -
A circularity with Apache FOP. To render PDF images, Batik uses FOP which in turn uses Batik, so depending on FOP would imply mixing EchoSVG and Batik. See issue #10.
-
Changes in the Java™ Platform.
To migrate from Apache Batik, you generally have to deal with the following:
-
Package names are now prefixed by
io.sf.carte.echosvg
instead oforg.apache.batik
. -
Class names that included the name "Batik" now have "EchoSVG".
-
The
codec
-transcoder
circular dependency was removed in the following way: a few classes from thecodec
module were moved totranscoder
. Nowtranscoder
explicitly depends oncodec
(but not the other way around). -
Tcl and Python 2.x scripting was removed (see issues #12 and #13). That scripting wasn't functional in Batik anyway.
-
The generic
rasterizer
module (and related files) was removed (svgrasterizer
is still available but no longer supports PDF graphics). See issue #10 for more details. -
SAXDocumentFactory
andSAXSVGDocumentFactory
no longer have constructors withString
arguments. Either remove the string argument or replace it by anull
and you should be fine. Alternatively, you can now use your ownXMLReader
in place of the parser class name. (The API change was made for security reasons) -
EchoSVG does not depend on
xml-apis-ext-1.3.04.jar
to provide the SVGOM and SMIL APIs (see #15). Ifxml-apis-ext
happens to be in your modulepath, you could configure an exclusion for it (in Maven or Gradle), and letsvgom-api
andsmil-api
(transitive dependencies of EchoSVG from the Web APIs project) do the job, as they are compatible with Batik. If your project requires the old SAC api which is provided byxml-apis-ext
as well, you can usesac.jar
as a replacement. -
EchoSVGSecurityManager
is deprecated for removal due to Security Manager API being deprecated for removal since Java 17. Similarly,RhinoClassLoader.getAccessControlContext()
and other security-related methods in other classes are deprecated for removal as well. The constructorApplicationSecurityEnforcer(Class, String)
is no longer public, please useApplicationSecurityEnforcer.createSecurityEnforcer(Class, String)
instead. -
BridgeContext
(in thebridge
module) gained aclose
method. -
SVGAnimationElementBridge.initializeAnimation()
gained aBridgeContext
argument and now returns aboolean
.
-
The old and deprecated
CSSValue
API was replaced by an API close to W3C's Typed OM. One of the consequences is that if your scripts callgetPresentationAttribute
onSVGStylable
objects,getPresentationAttributeValue
should be called instead, obtaining aCSSStyleValue
. Note that modern SVGOM has neither of those methods. -
The line-height property now has a global default of 1.1, instead of the mixture of 1.1 and 1 that Batik uses.
-
The
css.engine.value.css2
package was renamed tocss.engine.value.css
, given that CSS as a whole isn't versioned anymore.