Skip to content

How does export utilities work and how do I save my drawing ? #3778

Answered by ad1992
vineetdigit asked this question in Q&A
Discussion options

You must be logged in to vote

@vineetdigit looks like your queries are related to the npm package so I will summarize the usage of the 3 export utilities

  • exportToSvg - As you mentioned, this returns the svg of the exported elements.
  • exportToBlob This will return the blob representing the image in the canvas, you can specify the mime type here (ex "image/png", "image/jpeg"), so will be useful when you want to convert the drawings to image.
  • exportToCanvas - This returns the canvas with the exported elements, app state and dimensions. You can use this when you want to customize the canvas let's say add some custom drawing of yours, for example 👇🏻
const ctx = canvas.getContext("2d");
ctx.font = "30px Virgil";
ctx.stroke…

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
5 replies
@vineetdigit
Comment options

@ad1992
Comment options

@vineetdigit
Comment options

@ad1992
Comment options

@vineetdigit
Comment options

Answer selected by vineetdigit
Comment options

You must be logged in to vote
7 replies
@lukesmurray
Comment options

@vineetdigit
Comment options

@dwelle
Comment options

@resetmerlin
Comment options

@resetmerlin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
package:excalidraw @excalidraw/excalidraw
5 participants