Details
Description
Facing issue while using Batik 1.8(SVG to PNG Conversion using java) and converting image from svg to png.
Not sure what is the issue with NamedProfileCache classes initialization
My code is like below:
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); Reader stringReader = new StringReader(svgContent); TranscoderInput inputSvgImage = new TranscoderInput(stringReader); TranscoderOutput outputPngImage = new TranscoderOutput(byteArrayOutputStream); PNGTranscoder pngTranscoder = new PNGTranscoder(); pngTranscoder.transcode(inputSvgImage , outputPngImage);
Maven Dependencies used:
<dependency> <groupId>org.apache.xmlgraphics</groupId> <artifactId>batik-transcoder</artifactId> <version>1.8</version> </dependency> <dependency> <groupId>org.apache.xmlgraphics</groupId> <artifactId>batik-codec</artifactId> <version>1.8</version> </dependency>
Getting below errow message while converting from SVG to PNG:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.batik.ext.awt.color.NamedProfileCache
Please let me know what should we need to do to make it work properly...