Skip to main content

sdk.canvasapi.getexport

Home > @kittl/sdk > CanvasAPI > getExport

CanvasAPI.getExport property

Generate an export of the canvas content in the specified format.

This function allows you to export a specific board or set of nodes (objects or groups) from the canvas in various formats including raster (PNG, JPG), vector (SVG), document (PDF), and video (MP4) formats. The export respects the original aspect ratio.

Signature:

getExport: (options: GetExportOptions) => Promise<Blob | null>;

Example 1

// Export a board as a 2x resolution PNG const png = await canvasAPI.getExport({ format: 'png', target: { boardId: 'board-123' }, dimensions: { multiplier: 2 } });

Example 2

// Export specific nodes as SVG at 65536 pixels total resolution const svg = await canvasAPI.getExport({ format: 'svg', target: { nodeIds: \['node-1', 'node-2'\] }, dimensions: { pixelCount: 65536 } });