Reference Demo

scancod.es feature gallery

One page for every namespace in the toolkit: QR payload helpers, barcode renderers, Data Matrix, PDF417, export methods, and the core entrypoints. Use this as the reference page when checking what the library supports.

What this demo covers

The browser global is scanCodes. Load scancod.es.core.js first, then scancod.es.js.

Namespace Purpose Notes
scanCodes.core Original low-level renderer export. Browser and Node entrypoint for the renderer core.
scanCodes.QR General QR rendering and metadata. Supports text, URLs, and raw QR payloads.
scanCodes.Barcode 1D barcode renderer. Code 39, Code 128, ITF, EAN-8, EAN-13, UPC-A.
scanCodes.DataMatrix ECC 200 Data Matrix symbols. Returns symbol metadata from getInfo().
scanCodes.PDF417 Stacked 2D barcode renderer. Returns symbol metadata from getInfo().
scanCodes.payloads / helpers Structured payload builders. Same object, alias kept for compatibility.
scanCodes.EPC, WiFi, Geo, Email, SMS, Tel, VCard, MeCard, Event QR helper wrappers. Expose payload(), toCanvas(), toSVG(), toDataURL(), toSVGDataURL(), toDataURLAsync(), and getInfo().
  • browser global
  • Node.js require()
  • SVG / canvas export
  • metadata helpers
  • structured payload builders

Browser usage

<script src="scancod.es.core.js"></script>
<script src="scancod.es.js"></script>
<script>
  scanCodes.WiFi.toCanvas({
    ssid: 'OfficeNet',
    password: 'scancodes-2026',
    encryption: 'WPA2'
  }, document.getElementById('wifi'), {
    ecLevel: 'M',
    cellSize: 8
  });
</script>

Node.js usage

const scanCodes = require('./scancod.es.js');

const eventSvg = scanCodes.Event.toSVG({
  summary: 'Launch Review',
  start: '2026-06-01T10:00:00Z',
  end: '2026-06-01T11:00:00Z'
}, {
  ecLevel: 'Q'
});

Structured payload helpers

These wrappers build the QR payload for you and then reuse the same QR rendering surface.

Renderers and exports

These sections cover the raw renderers and their option surfaces.

1D barcode types

Type type value Character set
Code 39 code39 A-Z, 0-9, and - . space $ / + %
Code 128 (auto) code128 / code128auto Printable ASCII
Code 128 subset B code128b Printable ASCII subset B
Interleaved 2 of 5 i2of5 / itf Digits only
EAN-13 ean13 12 or 13 digits
EAN-8 ean8 7 or 8 digits
UPC-A upca 11 or 12 digits

Option surfaces

  • QR: ecLevel, margin, cellSize, width, dark, light, transparentBackground, finderColor, shape, minVersion, eci, logo, logoSize, logoPadding, logoBackground, title, description, mimeType.
  • Barcode: type, scale, height, quiet, displayValue, fontSize, dark, light, transparentBackground, textPosition, guardExtend, bearerBars, title, description, mimeType.
  • Data Matrix: cellSize, margin, dark, light, transparentBackground, title, description, mimeType.
  • PDF417: columns, ecLevel, scale, rowHeight, margin, dark, light, transparentBackground, title, description, mimeType.

Compatibility notes

  • QR uses byte mode only.
  • Data Matrix uses ASCII encodation with digit-pair compression.
  • PDF417 currently uses byte compaction only.
  • Code 128 auto/subset B does not implement GS1/FNC handling.