!7 lib 1013691 // batik lib 1013693 // batik svg lib 1013694 import org.apache.batik.transcoder.image.PNGTranscoder; import org.apache.batik.transcoder.TranscoderInput; import org.apache.batik.transcoder.TranscoderOutput; p-experiment { inputFilePath("Directory", voidfunc(File dir) { for (File svg : listFilesWithExtension(dir, "svg")) { print(svg); TranscoderInput input_svg_image = new TranscoderInput(fileToURI(svg)); OutputStream png_ostream = newFileOutputStream(getProgramFile(dropSuffix(".svg", svg.getName()) + ".png")); TranscoderOutput output_png_image = new TranscoderOutput(png_ostream); new PNGTranscoder t; t.addTranscodingHint(PNGTranscoder.KEY_WIDTH, 300f); t.transcode(input_svg_image, output_png_image); png_ostream.close(); } }); }