Comments (3)
You can call the canvas instance's toDataURL method and pass in some options for the download. There may be a more efficient/easier way to do this, but I just create an anchor on the DOM, set the href
and download
attributes, call the click()
method on it, then remove it with the remove()
method. Hope this helps!
const url = editor?.canvas.toDataURL({ format: 'png' })
const dl = document.createElement('a')
dl.href = url
dl.dowload = 'filename'
dl.click()
dl.remove()
from fabricjs-react.
yeah you can access fabricjs canvas from editor object, if you need to follow official documentation http://fabricjs.com/
from fabricjs-react.
closing due inactivity
from fabricjs-react.
Related Issues (20)
- Question - fabricjs browser only HOT 2
- useFabricJSEditor will return a new `editor` per render HOT 3
- Fabric v5 ? HOT 7
- canvas.on events fires two times HOT 3
- how can i change font size by progressbar please help me also want to make font bold italic underline HOT 2
- can you please help how to export canvas as pdf HOT 1
- How can I create multiple canvas and also store the current state of those canvases ? HOT 2
- How can I create multiple canvases and use them on single page. HOT 6
- change canvas using FabricJSCanvas? HOT 2
- Is it possible to change border-radius? HOT 3
- Upgrade to react18 HOT 2
- support custom build of fabricjs
- Text disappears on edit / selected HOT 2
- Adding new features to the package HOT 4
- How to do drawing like on a whiteboard? HOT 2
- How to get updated activeObject
- Touch Events Support HOT 4
- How To Use In A Class Component HOT 5
- Adding image adds multiple images one below another. HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fabricjs-react.