Description:
We currently support exporting the canvas to a PNG. We should extend this to support vector formats (SVG) and PDFs for better print quality.
How to Implement:
- SVG Export: Use Fabric's built-in
canvas.toSVG() method. Create a Blob from the SVG string (new Blob([svg], {type: 'image/svg+xml'})) and trigger a download via a hidden <a> tag.
- PDF Export: You can use a library like
jspdf. Convert the canvas to an image (or parse the SVG) and insert it into a PDF document using jspdf's API.
- UI Updates: Change the export button to a dropdown menu with PNG, SVG, and PDF options.
Description:
We currently support exporting the canvas to a PNG. We should extend this to support vector formats (SVG) and PDFs for better print quality.
How to Implement:
canvas.toSVG()method. Create a Blob from the SVG string (new Blob([svg], {type: 'image/svg+xml'})) and trigger a download via a hidden<a>tag.jspdf. Convert the canvas to an image (or parse the SVG) and insert it into a PDF document usingjspdf's API.