Open zolomatok opened 4 years ago
You can with https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL.
const container = document.createElement("div");
QrCode.render(
{
text: "some text",
radius: 0.5, // 0.0 to 0.5
ecLevel: "H", // L, M, Q, H
fill: "#536DFE", // foreground color
background: null, // color or null for transparent
size: 128 // in pixels
},
container
);
const canvas = container.firstChild;
const src = canvas.toDataURL();
// Send `src` to your users.
And now please without the canvas element actually present ... I want JUST the dataURL / image-data ...
Same. I'd like to use it in Google's AppScript.
I love that you created this lib! I'd like to generate an image on the backend and send it to the user by email. Can that be done?