Printing and Exporting
- 2 minutes to read
To invoke the standard Print dialog, select Print in the application menu in the Diagram Designer. The Print dialog allows you to select the printer (if required), specify the range of pages to print, the number of copies, etc. To invoke the dialog in code, use the DiagramControl.Print method.
The Quick Print application menu item immediately sends the diagram to the default printer. The corresponding method is DiagramControl.QuickPrint.
The Print Preview application menu item invokes the Print Preview dialog. The corresponding method is DiagramControl.ShowPrintPreview.
The Print Preview dialog allows you to select the printed page size. If you do not modify this setting, the drawing page size specified in the Page Setup Dialog Window is used.
Export
To export a diagram to a file, select Export As in the application menu. This command invokes the Export As dialog where you can specify the output format and file path.
Diagrams can be exported to the following formats: GIF, PNG, BMP, JPG, PDF, SVG.
The following export settings are available:
- DiagramOptionsExport.ExportDPI - the resolution (in dpi).
- DiagramOptionsExport.ExportMargin - the margin between diagram contents and page bounds.
- DiagramOptionsExport.PrintExportMode - allows you to export the diagram contents without padding (boundaries).
- DiagramOptionsExport.ExportScale - the scale factor.
You can override these settings in the parameters of the export methods.
Use the DiagramControl.ExportDiagram method to invoke the Export As dialog window. This window allows users to select any available file format.
Use the following methods to export the diagram to a specific format:
ExportToImage - exports to GIF, PNG, BMP, and JPG formats.
ExportToSvg - exports to vector (SVG) format.
DiagramControl.ExportToPdf - exports to a single-page PDF file.
DiagramControl.PrintToPdf - exports to a multi-page PDF document.
SVG Export Limitations
The following diagram elements cannot be exported to SVG:
- Items created or customized with the CustomDrawItem event
- Custom background
- Custom container collapse buttons