public static BufferedImage renderToImage(String url, int width, int height) throws Exception {
public static BufferedImage renderToImage(String url, int width, int height) {
    public static BufferedImage renderToImage(String url, int width, int height)            throws Exception {        Graphics2DRenderer g2r = new Graphics2DRenderer();        g2r.setDocument(url);        Dimension dim = new Dimension(width, height);        BufferedImage buff = new BufferedImage((int) dim.getWidth(), (int) dim.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);        Graphics2D g = (Graphics2D) buff.getGraphics();        g2r.layout(g, dim);        g2r.render(g);        g.dispose();        return buff;    }