cancel
Showing results for 
Search instead for 
Did you mean: 

PNG export using the API

michael_becker
Champ in-the-making
Champ in-the-making
Hi forum,

we are currently trying to implement an application that returns the image file (preferably in PNG format) for a given process definition. After searching around a while I could not find any feasible approach for writing a ProcessDefinitionEntity (or BPMNModel) into an image file using the activiti API.
Is there any way to write the image file using the API? I hope so, since it is possible to export processes into PNG using the web interface and the activiti modeler.

Thanks for your help!
Michael
2 REPLIES 2

michael_becker
Champ in-the-making
Champ in-the-making
Ah. Sometimes the solution is just too clear to see it. I just found the class <code>ProcessDiagramGenerator</code> providing the method <code>generatePngDiagram</code> returning an <code>InputStream</code> and everything works fine…

martin_grofcik
Confirmed Champ
Confirmed Champ
That's the one option. (I used the same approach when I changed ProcessDiagramCanvas for crystalball https://github.com/gro-mar/activiti-crystalball/blob/master/image-builder/src/main/java/org/activiti...). This process diagram canvas allows you to write short comments into nodes, highlight nodes with different colors…)

Another option is to use SVG generator on the client side
https://github.com/Activiti/Activiti/blob/master/modules/activiti-webapp-explorer2/src/main/webapp/d...

which could be interesting too.