Skip to content

php-barcode 2.1.0

Latest

Choose a tag to compare

@davidscotttufts davidscotttufts released this 02 Nov 12:57
0561fdf

Custom captions

Print your own text under any barcode instead of the encoded data: a product name, "Scan to pay", an address line.

Barcode::qrCode('https://example.com/pay')->withCaption('Scan to pay');
Barcode::ean13('400638133393')->withCaption('Organic Oat Milk 1L');
  • Works with all 59 types, including 2D codes, stacked DataBar, postal codes and MaxiCode. Captions rotate with ->vertical().
  • Also available as --caption in the CLI and caption= on barcode.php.

Fixes

  • Non-ASCII text in PNG output (captions, Code 128 data) is now transliterated for GD's ASCII-only built-in font ("Grüße" → "Grusse") instead of being drawn with the wrong characters. SVG, PDF, EPS and TrueType fonts already showed it correctly.

Full changes: #33 (requested in #25)