ArtQRCode
ArtQRCode copied to clipboard
Is there a way to generate these codes on NodeJs, as we cannot use dom there?
I am trying to generate bulk codes in a project. generating them on browser does not seems a good idea... Is there a possibility to generate codes server side?
Yes, it is possible you need to take the data from users and send it back to the server where QRcode will be generated and they will be stored as temporary files just (like we do with bytes io in python) and send back to the client.
maybe u can use Headless browser
I am able to generate on server side, by adding follwoing lines on top of artqrcodejs
import {Canvas} from 'canvas';
import {JSDOM} from 'jsdom';
const dom = new JSDOM('<!DOCTYPE html><div id="qr"></div>');
var document = dom.window.document;
global.Image = Canvas.Image;
i'll make a PR, so this library can be used on server side as well. This is very helpful for bulk qrCode generation.