Skip to main content

exportStyles

info

By default, all css styles included to the page are sent to the export service when exporting a DHTMLX Diagram. As a result, the size of the request increases that can cause the request to fail.

To avoid this problem, you can reduce the size of the exported data by applying the exportStyles property.

Description​

Optional. Defines the styles that will be sent to the export service when exporting the diagram

Usage​

exportStyles?: boolean;
//or
exportStyles?: string[];

Default config​

exportStyles: true

Example​

Set the exportStyles property to false to prevent all styles from being sent to the export service:

const diagram = new dhx.Diagram("diagram_container", {
exportStyles: false
});

Or define a set of styles you want to be exported. For that, you need to set string values with the absolute paths to the desired styles to the exportStyles array:

const diagram = new dhx.Diagram("diagram_container", {
exportStyles:[
"https://mySite.com/exportStyle.css",
"https://mySite.com/secondExportStyle.css"
]
});
tip

You must use only absolute paths not relative ones

Change log: Added in v3.1

Related article: Exporting Diagram

Related sample: Diagram. Export. Export styles