Plain CODE 39 reaches 43 characters. The extended form covers all 128 ASCII values by encoding anything outside those 43 as a pair, with $, %, / and + acting as shift characters.
Lower case and control characters therefore cost two CODE 39 characters each, and a symbol carrying mixed-case text comes out close to twice the width of the same text in upper case.
Type Token
| Item | Value |
|---|---|
| Type token | C39E |
| Enum case | BarcodeType::C39E |
| Family | Linear |
| Standard | ANSI MH10.8M-1983, USD-3 |
| Class | \Com\Tecnick\Barcode\Type\Linear\CodeThreeNineExt |
Input
| Item | Value |
|---|---|
| Character set | the 128 ASCII characters |
| Length | 1 to 30000 characters |
| Check | none. Use C39E+ for the modulo 43 check character |
| Extra parameters | none |
Examples
Digits
<?php
require_once __DIR__ . '/vendor/autoload.php';
$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
type: 'C39E',
code: '0123456789',
width: -3,
height: -30,
color: 'black',
padding: [0, 0, 0, 0],
)->setBackgroundColor('white');
echo $bobj->getInlineSvgCode();
Mixed case, reached through the shift pairs
$bobj = $barcode->getBarcodeObj(
type: 'C39E',
code: 'tc-lib-barcode',
width: -3,
height: -30,
color: 'black',
padding: [0, 0, 0, 0],
)->setBackgroundColor('white');
Errors
These payloads raise \Com\Tecnick\Barcode\Exception:
| Payload | Message |
|---|---|
caf\xC3\xA9 | Invalid character: 195 |
See Also
- tc-lib-barcode : the library overview.
- Rendering Options : size, colour, padding.
- Output Formats : every renderer.
- CODE 39 : the 43-character form.
- CODE 39 Extended with check character : the same, with a check character.
- API reference : the generated class documentation.