Multi-library barcode generation. A simple GET returns SVG, PNG, BMP, or JPEG.
zxing — types: qr, qrcode, code128, c128, code39, code93, ean13, ean8, upca, upce, itf, i2of5, codabar, datamatrix, dm, pdf417, aztecGET /barcode/{library} — maps query params onto the library.
| Param | Meaning |
|---|---|
data | required — content to encode |
type | symbology (default qrcode) — see library list above |
format | svg | png | bmp | jpeg (default png; also honors Accept) |
width / height | requested output size in px |
margin | quiet-zone in modules |
scale | integer pixel multiplier (1–64) |
ecc | QR error-correction L|M|Q|H |
charset | character set hint |
shape | DataMatrix only: square (default) | rectangle | none |
gs1 | true to treat data as GS1 |
GET /gs1/{library} — inserts FNC1 / group separators for you. Defaults to GS1 DataMatrix.
(400){po}(90){ship}: ?po=...&ship=...?data=(400)...(90)...type = datamatrix (default) or qrcode/barcode/zxing?type=qrcode&data=https://ilc.example/&format=png&scale=5/barcode/zxing?type=code128&data=HELLO123&format=svg/gs1/zxing?po=2010C100005637&ship=S197591&type=datamatrix&format=png&scale=6/gs1/zxing?po=2010C100005637&ship=S197591&type=qrcode&format=svg/gs1/zxing?po=2010C100005637&ship=S197591&type=datamatrix&shape=rectangle&format=pngDataMatrix is square by default. Pass shape=rectangle for a
rectangular symbol, or shape=none to let ZXing choose. Size 2D symbols with
scale (pixels per module); 1D symbols with width/height.
Drop an Image element on the band, set its Expression Class to
java.net.URL, and use PNG output. Concatenate your fields into the URL.
The host below matches whatever address you loaded this page from
(https://report-barcode.ilcdev.com).
URL + YOUR DATA — for the GS1 DataMatrix (PO + ship number):
new java.net.URL(
"https://report-barcode.ilcdev.com" +
"/gs1/zxing?type=datamatrix&format=png&scale=6" +
"&po=" + $F{customer_po} +
"&ship=" + $F{ship_num}
)
Generic Code 128 from a single field:
new java.net.URL(
"https://report-barcode.ilcdev.com" +
"/barcode/zxing?type=code128&format=png" +
"&data=" + $F{my_value}
)
The GS1 po/ship values are plain alphanumerics, so no URL-encoding
is needed. For the generic data= param, URL-encode if your value may contain
spaces or symbols.