Barcodes as image
Generate barcodes as image following the same logic as for Pictures:
Insert a temporary picture in your template (white
JPEG
image, or catPNG
image). The temporary image is used to find the location to insert the barcode.Write the marker followed by the barcode formatter into the alternative text, description, or title of the image. The format should be:
{d.value:barcode(type)}
. Refer to Pictures for more info.Insert the
type
of barcode as a first argument of the formatter:barcode
. Refer to theSupported barcodes below.Generate the document.
Barcode options are available and can be passed to the barcode
formatter as a second argument, such as :barcode(type, options1, options2, ...)
. Refer to the Barcodes options below.
Example
This example shows how to insert 3 barcodes as images:
ean13
qrcode
gs1
Data
Retrieve your barcode data as
JSON
from your database.Edit your template in a text editor, insert 3 temporary images. For each image, write as an alternative text tags:
First image:
{d.urlQrCode:barcode(qrcode)}
Second image:{d.productCodeBarEan13:barcode(ean13)}
Third image:
{d.productGs1:barcode(gs1-128)}
Supported barcodes
Barcodes options
Pass the option as a second argument in any order. The option must keep the format "optionName:value", such as {d.number:barcode(qrcode, width:300, height:100, includetext:false, scale:1)}
.
Last updated