Export canvas as image
Export the entire visible canvas or part of the canvas as an image
Exporting a Sheet Region
Basic Usage
import { SpreadsheetProvider, CanvasGrid, useSpreadsheet } from "@rowsncolumns/spreadsheet";
const MySpreadsheet = () => {
const { exportRegion } = useSpreadsheet()
const handleExport = () => {
exportRegion?.(
{
startRowIndex: 1,
endRowIndex: 10,
startColumnIndex: 1,
endColumnIndex: 5,
},
"my-spreadsheet-export", // filename (without extension)
"image/png" // MIME type
);
};
return (
<>
<button onClick={handleExport}>
Export Region as Image
</button>
<CanvasGrid />
</>
);
};
const App = () => (
<SpreadsheetProvider>
<MySpreadsheet />
</SpreadsheetProvider>
);Export Options
Image Format
Range Selection
Export Current Selection
Export with Custom Filename
Exporting Entire Canvas
Complete Example
Use Cases
Report Generation
Data Visualization Sharing
Documentation
Limitations
Best Practices
Browser Compatibility
Last updated