Skip to content

Images

Img API provides a way to generate images from templates, barcodes, and QR codes.

Get SVG file based on template

HTTP
curl {{host}}/api/core/img/svg/{{appname}}/{{svgtemplate}} \
-H "Authorization: Token {{token}}"

Note

  • svgtemplate - template without extension
  • Templates are stored in templates/filename.svg folder
  • app_name - www - for system templates
  • {key} - template keys are replaced with values from query string

Get Barcode from text

Maximum character length is 80 characters. If less than 23 characters

HTTP
curl {{host}}/api/core/img/barcode?code={{code}} \
-H "Authorization: Token {{token}}"

HTML

HTML
<img src="/api/core/img/barcode?code={code}&width=350" class="xs-image"  alt="Barcode">
Markdown
![Barcode](/api/core/img/barcode?code={code})

Barcode API will generate Code128 Barcode ,

Optional query parameters:

  • code - Valid EAN 128 CODE
  • l - label true/false , default true
  • w - set the width of the barcode, default 300
  • h - set height default 60

Get QRCode from text

Optional query parameters:

  • quietzone = false
  • pixelspermodule =2
HTTP
curl {{host}}/api/core/img/qrcode?code={{code}} \
-H "Authorization: Token {{token}}"
HTML
<img src="/api/core/img/qrcode?code={code}" class="xd-image"/>
Markdown
![QRCODE](/api/core/img/qrcode?code={code})

Get QRCode as DXF

Generates a QR code as a DXF vector file (units: mm) for laser engravers and CNC software (LightBurn, RDWorks, LaserGRBL, Inkscape). The file is returned as a download named qrcode.dxf.

HTTP
curl {{host}}/api/core/img/qrcodedxf?code={{code}}&modulesize=1&ecc=M&label={{label}} \
-H "Authorization: Token {{token}}" -o qrcode.dxf
HTML
<a href="/api/core/img/qrcodedxf?code={code}&label={code}">QR code DXF</a>

Query parameters:

  • code - text to encode, required, max 1000 characters
  • modulesize - size of one QR square in mm, 0.1-20, default 1
  • ecc - error correction level L, M, Q or H, default M
  • label - optional text engraved below the code, max 100 characters

Note

  • Final width = number of QR modules × modulesize, e.g. 21 modules × 1 mm = 21 mm. The quiet zone is not included - leave a blank margin around the code yourself.
  • Higher ecc survives engraving imperfections better, but makes the code denser (more modules).
  • The QR code is drawn as closed rectangles on layer QR - set this layer to fill/scan mode in the laser software.
  • The label is drawn as letter outlines on layer LABEL, one module below the code - no font is needed in the laser software. Text height is 4 modules, shrunk to the code width if longer; single line only.
  • Format: DXF R12 (AC1009), compatible with most CAD/CAM tools.

Errors (HTTP 400): missing code, text too long (or too long for a QR code at the selected ecc), modulesize out of range, invalid ecc, label too long.