Answer the question
In order to leave comments, you need to log in
Fabric js - how to save image to jpg?
There is fabric js canvas with id canvas . How to save a canvas image as a jpg? Or png?
Answer the question
In order to leave comments, you need to log in
var image = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
window.location.href=image;
The canvas has a toDataURL method that takes an options hash. Pass in the desired format in it: jpeg or png. You can read more about it in the documentation
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question