我正在使用Gradle来获取Batik(一个SVG库)并开箱即用,它缺少一些传递库.我应该放哪一个?
我已经尝试过获取xml-api或Xerces lib
摇篮:
version = 1.0
mainClassName = 'com.foilen.svgexporter.SvgExporter'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
dependencies {
compile 'args4j:args4j:2.32'
compile 'org.apache.xmlgraphics:batik-rasterizer:1.8'
}
Java代码:
PNGTranscoder transcoder = new PNGTranscoder();
InputStream in = new FileInputStream("character_man_black.svg");
TranscoderInput input = new TranscoderInput(in);
OutputStream ostream = new FileOutputStream("character_man_black.png");
TranscoderOutput output = new TranscoderOutput(ostream);
transcoder.transcode(input, output);
// Flush and close the output.
o