Skip to main content

Exporting Diagram

You can export a diagram into the PDF or PNG format via the related pdf()/png() methods of the Export object:

To adjust the export settings, pass an object with configuration options to the necessary method.

Check the list of available settings:

Exporting styles

By default, all CSS styles included on the Diagram page are sent to the export service. As a result, the request size increases, which can cause it to fail.

The library allows you:

  • to prevent all styles from being sent to the export service by setting the exportStyles configuration property of the Diagram object to false:
const diagram = new dhx.Diagram("diagram_container", {
exportStyles: false
});
  • to define a set of styles that you want to be exported by setting absolute paths to the desired styles in the exportStyles array:
note

You must use only absolute paths, not relative ones.