Skip to content

How to make exportToSvg embed scene content ? #3756

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

You must be logged in to vote

@bric3 thanks for pointing this out, yes you are right now the utils which are exported exportToSvg, exportToPng do not support embedding the scene.
If you notice it expects a metadata attribute, whatever is send in metadata will be embedded in the SVG/PNG.
The way it works in excalidraw is we send the metadata as shown here. We will add this support soon but till then as a workaround, if you are blocked at this you will have to pass metadata so that scene is embedded.
You can clone encodeSvgMetadata and encodePngMetadata to get the metadata and pass it to the export utilites.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@ad1992
Comment options

@bric3
Comment options

Answer selected by bric3
Comment options

You must be logged in to vote
1 reply
@bric3
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
2 participants