How to access the svg’s actual width/height values?

Hi all,

I want to use bpmn-js to embed bpmn diagrams in
asciidoc generated html. What I would need is to access the „normal“
(default) width and height of the rendered svg, before I call
canvas.zoom('fit-viewport‘) to zoom it to the enclosing container. Why?
Because before zooming, within asciidoc html I need to force/set that
container to proper width/height values that fit to the diagram
dimensions.

How can I access the svg’s actual width/height dimensions in pixels?

Many thx,
Martin

You can retrieve the viewbox via canvas.viewbox().

It gives you access to the outer (i.e. <svg />) and inner (i.e. diagram contents) size.