public BufferedImage renderToImage(String uri, int width, int height) throws IOException {
return renderToImage(uri, width, height, false, null, null);
}
public BufferedImage renderToImage(String uri, int width, int height, boolean stretch, String idRegex, Color replacementColor) throws IOException {
SAXSVGDocumentFactory df = new SAXSVGDocumentFactory("org.apache.xerces.parsers.SAXParser");
SVGDocument document = df.createSVGDocument(uri);
if(idRegex != null && replacementColor != null)
replaceFill(document, idRegex, replacementColor);
return renderToImage(document, width, height, stretch);
}