barcode
Appends a 1D barcode encoding data with the chosen symbology.
BarcodeSymbology.Code128 (default): printable ASCII 32–126; digit runs compress automatically via code set C and the mandatory mod-103 checksum is appended for you.
BarcodeSymbology.Ean13: 12 digits (check digit computed) or 13 digits (check digit verified).
BarcodeSymbology.UpcA: 11 digits (check digit computed) or 12 digits (check digit verified); rendered as the equivalent EAN-13 symbol.
Readers expect a quiet zone of roughly ten modules on both sides — give the barcode some horizontal breathing room. The human-readable caption customary under retail barcodes is not drawn automatically; add a centred text(data) below when you need one.
Parameters
payload; invalid input for the symbology throws IllegalArgumentException.
which 1D encoding to use; defaults to Code 128.
rendered width; null uses the symbol's natural size of one PDF point per module.
bar height — taller bars are easier to scan.
bar colour.
fill behind the bars; null for transparent.