Skip to content

Text Positioning

Terry Burton edited this page Jan 31, 2026 · 29 revisions

Text Positioning

textxalign

The textxalign option is used to specify where to horizontally position the text.

Example: textxalign=offleft

Data:    Test
Options: includetext alttext=Test textxalign=offleft
Encoder: datamatrix

Example: textxalign=left

Data:    Test
Options: includetext alttext=Test textxalign=left
Encoder: datamatrix

Example: textxalign=center

Data:    Test
Options: includetext alttext=Test textxalign=center
Encoder: datamatrix

Example: textxalign=right

Data:    Test
Options: includetext alttext=Test textxalign=right
Encoder: datamatrix

Example: textxalign=offright

Data:    Test
Options: includetext alttext=Test textxalign=offright
Encoder: datamatrix

Example: textxalign=justify

Data:    Test
Options: includetext alttext=Test textxalign=justify
Encoder: datamatrix

textyalign

The textyalign option is used to specify where to vertically position the text.

Example: textyalign=below

Data:    Test
Options: includetext alttext=Test textyalign=below
Encoder: qrcode

Example: textyalign=bottom

Data:    Test
Options: includetext alttext=Test textyalign=bottom
Encoder: qrcode

Example: textyalign=center

Data:    Test
Options: includetext alttext=Test textyalign=center
Encoder: qrcode

Example: textyalign=top

Data:    Test
Options: includetext alttext=Test textyalign=top
Encoder: qrcode

Example: textyalign=above

Data:    Test
Options: includetext alttext=Test textyalign=above
Encoder: qrcode

textdirection

The textdirection option is used to specify in which direction to orient text.

  • textdirection=forward
  • textdirection=backward
  • textdirection=upward
  • textdirection=downward

Example

Data:    Test
Options: includetext alttext=Test textxalign=offright textdirection=upward
Encoder: datamatrix

textxoffset

The horizontal position of the text in points relative to the leftmost bar or modules.

Example

Data:    TEST
Options: includetext textxoffset=-40
Encoder: code39

textyoffset

The vertical position of the text in points relative to the base of the bars or modules.

Example

Data:    TEST
Options: includetext textyoffset=-20
Encoder: code39

Notes

  • 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.

extratextxalign, extratextyalign, extratextdirection, extratextxoffset, extratextyoffset

Any extra text can be positioned using the extratextxalign, extratextyalign, extratextdirection, extratextxoffset and extratextyoffset options that function the same as their textxalign, textyalign, textdirection, textxoffset and textyoffset analogues.

Clone this wiki locally