How to use the qrcode.toCanvas function in qrcode

To help you get started, we’ve selected a few qrcode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LedgerHQ / ledger-live-desktop / src / components / base / QRCode / index.js View on Github external
drawQRCode() {
    const { data, size, errorCorrectionLevel } = this.props
    const { current } = this.canvas
    if (!current) return
    qrcode.toCanvas(
      current,
      data,
      {
        width: current.width,
        margin: 0,
        errorCorrectionLevel,
      },
      () => {
        // fix again the CSS because lib changes it –_–
        current.style.width = `${size}px`
        current.style.height = `${size}px`
      },
    )
  }
github karlcswanson / micboard / js / app.js View on Github external
export function generateQR() {
  const qrOptions = {
    width: 600,
    margin: 0,
  };

  const url = micboard.localURL + location.pathname + location.search;
  document.getElementById('largelink').href = url;
  document.getElementById('largelink').innerHTML = url;
  QRCode.toCanvas(document.getElementById('qrcode'), url, qrOptions, (error) => {
    if (error) console.error(error)
    console.log('success!');
  });

  document.getElementById('micboard-version').innerHTML = 'Micboard version: ' + VERSION;
}
github Nice-Ming / Questionnaire-management / src / components / List.vue View on Github external
sharePaper(id) {
			let canvas = document.getElementById('qrcode-canvas')
			this.shareLink = `${window.location.origin}/questionnaire/#/fill?id=${id}`
			QRCode.toCanvas(canvas, this.shareLink, {
				width: 250
			}, function (error) {
				if (error) console.error(error)
			})
			this.isShowSharePrompt = true
		},
github bulwark-crypto / bulwark-explorer / client / component / Card / CardAddress.jsx View on Github external
drawQRCode = () => {
    const el = document.getElementById('qr-code');
    qrcode.toCanvas(el, this.props.address, { width: 220 }, (err) => {
      if (err) {
        console.log(err);
      }
    });
  };
github LedgerHQ / ledger-live-common / tools / src / demos / bridgestream / index.js View on Github external
drawQRCode() {
    const { data, size, errorCorrectionLevel } = this.props;
    qrcode.toCanvas(this._canvas, data, {
      width: size,
      margin: 0,
      errorCorrectionLevel,
      color: {
        light: "#ffffff"
      }
    });
  }
github snowypowers / ansy / src / QR.js View on Github external
const makeQR = (cvs, str) => {
  QRCode.toCanvas(cvs, str, { version: 5 }, (err) => {
    if (err) alert(err)
  })
}
github datenanfragen / website / src / Utility / bank-transfer-codes.js View on Github external
export function renderEpcrQr(canvas_element, amount, reference, light_color = null) {
    QRCode.toCanvas(canvas_element, epcrData(amount, reference), {
        errorCorrectionLevel: 'M',
        width: 256,
        height: 256,
        color: { light: light_color || '#f7fafc' }
    });
}
github LedgerHQ / ledger-live-common / tools / src / demos / qrstreambenchmark / index.js View on Github external
drawQRCode() {
    const { data, size, errorCorrectionLevel } = this.props;
    qrcode.toCanvas(this._canvas, data, {
      width: size,
      margin: 0,
      errorCorrectionLevel,
      color: {
        light: "#ffffff"
      }
    });
  }
github LedgerHQ / ledger-live-common / tools / src / demos / qrledger / index.js View on Github external
drawQRCode() {
    const { data, size, errorCorrectionLevel } = this.props;
    qrcode.toCanvas(this._canvas, data, {
      width: size,
      margin: 0,
      errorCorrectionLevel,
      color: {
        light: "#ffffff"
      }
    });
  }