Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post-update API #29

Open
zpao opened this issue Apr 28, 2017 · 2 comments
Open

Post-update API #29

zpao opened this issue Apr 28, 2017 · 2 comments

Comments

@zpao
Copy link
Owner

zpao commented Apr 28, 2017

There are a couple canvas APIs that could be nice to expose, specifically toDataURL and toBlob, primarily to do something with the canvas data (most obvious is download the file).

I'm thinking perhaps something like this:

this.props.onUpdate({
  toDataURL: canvas.toDataURL,
  toBlob: canvas.toBlob
})

This sidesteps the problem of having to figure out how to get the non-default args for those calls without ballooning the component API.

I'm not sure if anybody cares but figured I'd post this idea now before I forget (instead of just shipping it at midnight with very little thought)

(back here on this because of #19 and re-reading #17)

@Plorark
Copy link

Plorark commented Jun 19, 2018

Any updated on this? It's been a year :(

@brilang
Copy link

brilang commented Sep 17, 2018

I would be very interested in having access to the toDataURL API. I'm working on a project to generate a page full of unique QR codes to push into a PDF File. I'm planning on using jsPDF which has the following sample code (https://parall.ax/products/jspdf) for putting an image into a PDF:

// You'll need to make your image into a Data URL
// Use http://dataurl.net/#dataurlmaker
var imgData = <SNIPPED for brevity>
var doc = new jsPDF()

doc.setFontSize(40)
doc.text(35, 25, 'Paranyan loves jsPDF')
doc.addImage(imgData, 'JPEG', 15, 40, 180, 160)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants