# Exporting to PDF, Image, or SVG

The Kendo UI for Angular Diagram supports exporting to PDF, image, or SVG through the Diagram's built-in [`exportVisual`](https://www.telerik.com/kendo-angular-ui-develop/components/diagrams/api/diagramcomponent#exportvisual) method and the [Drawing API](https://www.telerik.com/kendo-angular-ui-develop/components/drawing).

The following example demonstrates how to export the Diagram component to PDF, image, or SVG formats using the `exportVisual` method.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/diagrams/export-options/source.txt)

To export the Kendo UI for Angular Diagram component to PDF, image, or SVG, you can use the Diagram's built-in `exportVisual` method along with the `Drawing API`. The following steps outline how to achieve this:

1. Access the Diagram component by using a template reference variable in your template:

   ```html
   <kendo-diagram #diagram></kendo-diagram>
   <button kendoButton (click)="exportToPDF(diagram)">Export Diagram to PDF</button>
   ```

2. Use the Diagram's `exportVisual` method to get the visual representation of the diagram as a drawing element:

   ```ts
   public exportToPDF(diagram: DiagramComponent): void {
     // Get the visual representation of the diagram
     const diagramVisual = diagram.exportVisual();

     // Export the visual to PDF
     exportPDF(diagramVisual).then((result) => {
       saveAs(result, 'diagram.pdf');
     }).catch((error) => {
       console.error('Error exporting PDF:', error);
     });
   }
   ```

3. Export the visual to your preferred format by passing it to [`exportPDF`](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api/pdf/exportpdf), [`exportImage`](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api/exportimage), or [`exportSVG`](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api/exportsvg), and then save the exported file using [`saveAs`](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api/pdf/saveas) with your desired file name and extension.

That's it! You can now export the Kendo UI for Angular Diagram component to PDF, image, or SVG using the `exportVisual` method.

## See Also

* [Exporting Diagram to XML](https://www.telerik.com/kendo-angular-ui-develop/components/knowledge-base/diagram-export-to-xml)
* [Drawing Exporting to PDF](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/pdf-output)
* [Drawing Exporting to Image](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/export-images)
* [Drawing Exporting to SVG](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/export-svg)
* [Diagram API Reference](https://www.telerik.com/kendo-angular-ui-develop/components/diagrams/api)
* [Drawing API Reference](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api)
