if (StringUtils.isBlank(svg)) {
throw new Exception("Missing 'svg' parameter");
}
final InputStream in = new ByteArrayInputStream(svg.getBytes("UTF-8"));
final ByteArrayOutputStream out = new ByteArrayOutputStream();
converter.convert(in, out, size);
out.flush();
byte[] doc = out.toByteArray();
return Response.ok(doc).type(converter.getContentType()).header(
"content-disposition",
"attachment; filename = chart." + converter.getExtension()).header(