Is there a way to export the diagram to pdf, and also each subprocess should be in different page of the PDF!!
Example: Whole diagram is on page 1, first sub-process on page 2, and so on…
Can someone please assist?
Is there a way to export the diagram to pdf, and also each subprocess should be in different page of the PDF!!
Example: Whole diagram is on page 1, first sub-process on page 2, and so on…
Can someone please assist?
No out-of-the-box solution, I believe.
Thanks!!
Also, when I import bpmn-to-image then it says missing module: puppeteer, So I installed the module.
Now after installing the module, I face following error just by importing “bpmn-to-image” module:
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.
Please assist @nikku .
If you are stuck with a particular problem, provide the necessary context. Phrase your post so that we can follow your line of thought, step by step.
Share details on your setup. Open a bug report with full details if you thing you uncovered a bug. We cannot help you, if we can’t reproduce your issue.
Thanks ![]()
Actually, we are using bpmn-js to create flow diagrams, and we want to save the diagram in pdf format. For this, we tried to use the bpmn-to-image library. But after installing, and just importing the module (even not used the library), first I got the error that missing module puppeteer. So installed the puppeteer library and after that got many errors in the react app console and app stopped running:
Errors: BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. and many others.

No idea why this happened. After removing the import, the react app works fine.
Versions of the modules used:
“bpmn-to-image”: “^0.9.0”
“bpmn-js”: “7.3.0”,
“bpmn-js-properties-panel”: “^0.46.0”,
“bpmn-moddle”: “^8.0.1”,
“puppeteer”: “^24.4.0”,
“react”: “^18.2.0”
Can you please assist!!
It’s likely a mismatch of versions between Node and some packages. Could you provide a CodeSandbox with the minimal code to reproduce your problem?
bpmn-to-image is a Node command line tool that drives Puppeteer, so it can’t be bundled into a React app; that’s why webpack asks for Node polyfills. Remove it from the frontend and export in the browser instead.
saveSVG on the modeler returns the current diagram as an SVG string. For subprocesses, bpmn-js 9 and later shows collapsed subprocesses as separate planes: switch with canvas.setRootElement, call saveSVG again, and collect one SVG per plane. Your 7.3.0 predates drilldown, so upgrading is the real first step for the one subprocess per page requirement.
Then build the PDF client side with jsPDF plus the svg2pdf.js plugin: add one page per SVG, size each page to that SVG’s viewBox, and save. The output stays vector, so it is sharp when zoomed or printed.
If you would rather do it on a server, keep bpmn-to-image there and merge the per diagram PDFs with pdf-lib.
(Disclosure: I’m connected to thirds.ai.)