Saving Images #2642
Answered
by
kumilingus
makleo2002
asked this question in
Q&A
Saving Images
#2642
-
Introductionhow do I save an image from paper in SVG JPG PNG formats and then download it? Steps to reproduceNo response Restrictions & ConstraintsNo response Does your question relate to JointJS or JointJS+. Select both if applicable.JointJS, JointJS+ |
Beta Was this translation helpful? Give feedback.
Answered by
kumilingus
May 6, 2024
Replies: 1 comment
-
You are looking for format.Raster and format.SVG plugins. There are several examples of how to export a diagram to an image: https://www.jointjs.com/demos?feature=Export+to+PNG%2FJPEG And here's a simple example: import { format, util } from '@joint/plus';
/*... */
format.toSVG(
paper,
(svg) => {
util.downloadDataUri(
`data:image/svg+xml,${encodeURIComponent(svg)}`,
'joint-plus.svg'
);
},
{ useComputedStyles: false }
); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
makleo2002
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are looking for format.Raster and format.SVG plugins.
There are several examples of how to export a diagram to an image: https://www.jointjs.com/demos?feature=Export+to+PNG%2FJPEG
And here's a simple example: