Is there a way to export a canvas element with multiple objects to html with javascript code using fabricjs?I know i can export toJSON or toObject but this isnt HTML.
I found that http://canvimation.github.com/ has a function(file>export canvas to html) to export a canvas drawing to native html code.Is that possible with fabricjs?
Fabric only supports export to (its own) object representation, JSON (basically a serialization of that object representation), and SVG.
If your goal is to create something in fabric, then export it for use in environment that doesn’t support canvas, then maybe you can use SVG — as long as SVG is supported in that environment.
You also have to understand that there’s no such thing as “native html code”. There are different versions of HTML — HTML4, HTML5, etc. Canvas is considered to be part of current HTML standard (HTML5). So drawing something on canvas could definitely be considered “using native html code” 😉
If you want recreate fabric rendering without canvas and without SVG then there’s really nothing fabric can help with. It would be unnecessarily complicated to try to provide canvas-less rendering of complex SVG shapes, images (under various transformations, like scaling/rotation), and other objects.