-
-
Notifications
You must be signed in to change notification settings - Fork 75
Text Positioning
Terry Burton edited this page Jan 31, 2026
·
29 revisions
The textxalign option is used to specify where to horizontally position the text.
textxalign=offlefttextxalign=lefttextxalign=centertextxalign=righttextxalign=offrighttextxalign=justify
The textyalign option is used to specify where to vertically position the text.
textyalign=belowtextyalign=bottomtextyalign=centertextyalign=toptextyalign=above
The textdirection option is used to specify in which direction to orient text.
textdirection=forwardtextdirection=backwardtextdirection=upwardtextdirection=downward
The horizontal position of the text in points relative to the leftmost bar or modules.
The vertical position of the text in points relative to the base of the bars or modules.
- By default (in the absence of textxalign or textyalign), each character of text is placed immediately below the corresponding modules where this is possible.
- Where there isn't such a direct relationship then the default is to position the text centrally beneath the symbol.
- Any extra text can be position using the
extratextxalign,extratextyalign,extratextdirection,extratextxoffsetandextratextyoffsetoptions that function the same as theirtextxalign,textyalign,textdirection,textxoffsetandtextyoffsetanalogues.
Code 128 with horizontally centered text:
Data: Test123
Options: includetext textxalign=center
Encoder: code128

QR Code with text positioned above the symbol:
Data: Test
Options: includetext alttext=Test textyalign=above
Encoder: qrcode

Data Matrix with text oriented upward to the right of the symbol:
Data: Test
Options: includetext alttext=Test textxalign=offright textdirection=upward
Encoder: datamatrix

Code 39 with adjusted text position:
Data: TEST
Options: includetext textxoffset=10 textyoffset=5
Encoder: code39

Home | Download | Documentation (PDF) | Source | Support | Issues | Online Barcode Generator