Hello,am using the following two codes to generate process diagrams, but the result is same and the out put image is truncated: http://postimg.org/image/5ul769n7x/
final InputStream definitionImageStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), processDefinition.getDiagramResourceName());
String imageExtension = extractImageExtension(processDefinition.getDiagramResourceName());
String fileName = UUID.randomUUID() + "." + imageExtension;
File downloadsTmp = new File(downloadsPath);
FileManagmentHelper.writeFileFromStream(definitionImageStream, new File(downloadsTmp, fileName));
final InputStream definitionImageStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), processDefinition.getDiagramResourceName());
String imageExtension = extractImageExtension(processDefinition.getDiagramResourceName());
String fileName = UUID.randomUUID() + "." + imageExtension;
File downloadsTmp = new File(downloadsPath);
FileManagmentHelper.writeFileFromStream(definitionImageStream, new File(downloadsTmp, fileName));