is there any libraries to convert SVG to JPG ? else than BATIK ? i used BATIK but i found some problems like this exception :
java.lang.NullPointerException at org.apache.batik.css.engine.CSSEngine.getCascadedStyleMap(CSSEngine.java:684) at org.apache.batik.css.engine.CSSEngine.getComputedStyle(CSSEngine.java:755) at org.apache.batik.bridge.CSSUtilities.getComputedStyle(CSSUtilities.java:96) at org.apache.batik.bridge.CSSUtilities.convertDisplay(CSSUtilities.java:509) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:176) at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:148) at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:76) at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:165) at org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:86) at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:132)
this is my code :
JPEGTranscoder transcoder = new JPEGTranscoder();
transcoder.addTranscodingHint(JPEGTranscoder.KEY_XML_PARSER_CLASSNAME,
"org.apache.crimson.parser.XMLReaderImpl");
transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,
new Float(1.0));
TranscoderInput input = new TranscoderInput(new FileInputStream("C:/Taha/SmartPlannerNew/rectangles.svg"));
OutputStream ostream = new FileOutputStream("C:/Taha/SmartPlannerNew/out.jpg");
TranscoderOutput output = new TranscoderOutput(ostream);
try {
transcoder.transcode(input, output);
} catch (TranscoderException e) {
System.out.println("error***************************************************************************************************************************");
e.printStackTrace();
}
System.out.println("done.");
ostream.close();
System.exit(0);
can any one help me please ?
my mistake was that i was using different versions of jar files i deleted all my jars and downloaded a new set of jars from the same
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With