PGraphicsPDF canvas = (PGraphicsPDF) p.createGraphics(p.width,
p.height, PConstants.PDF, f.getAbsolutePath());
canvas.beginDraw();
r.render(canvas, 0, 0, canvas.width, canvas.height,true);
canvas.endDraw();
canvas.dispose();
// canvas.save(f.getAbsolutePath());
} catch (RuntimeException e)
{
e.printStackTrace();
} finally