Label processTitle = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
processTitle.addStyleName(ExplorerLayout.STYLE_H3);
processImageContainer.addComponent(processTitle);
StreamSource streamSource = null;
byte[] editorSourceExtra = repositoryService.getModelEditorSourceExtra(modelData.getId());
if (editorSourceExtra != null) {
InputStream svgStream = new ByteArrayInputStream(editorSourceExtra);
TranscoderInput input = new TranscoderInput(svgStream);
PNGTranscoder transcoder = new PNGTranscoder();
try {
// Setup output
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
TranscoderOutput output = new TranscoderOutput(outStream);
// Do the transformation
transcoder.transcode(input, output);
final byte[] result = outStream.toByteArray();
outStream.close();
streamSource = new StreamSource() {
private static final long serialVersionUID = 1L;
public InputStream getStream() {
InputStream inStream = null;
if (result != null) {