Search
DiagramView.printPreview Method
See Also
 





Exports the diagram as a list of images to a new HTML document.

Namespace: MindFusion.Diagramming
Package: DiagramView.js

 Syntax

JavaScript  Copy Code

function printPreview ([options])

 Parameters

options
Optional.

Object. An object, containing customization properties, including printArea (defaults to diagram.getContentBounds()) and pageSize (defaults to diagramView.viewport).

 Example

JavaScript  Copy Code

document.getElementById("printPreview").addEventListener("click", () => {
    var diagramView = DiagramView.find("diagram");

    // preferred image size is A4 with subtracted margins
    var A4 = new Size(210, 297);
    A4.width -= 25.4;
    A4.height -= 25.4;

    diagramView.printPreview(
        {
            printArea: diagramView.diagram.bounds,
            pageSize: A4
        });
});

 See Also