Deutsche Post Leitcode

Deutsche Post Leitcode barcode in PHP: 14 digit input, check digit, code example and SVG output

Leitcode routes the item rather than identifying it: five digits of postcode, three of street, three of house number, two of product code, and a check digit. Same symbology as Identcode, two digits longer.

Type Token

ItemValue
Type tokenLEITCODE
Enum caseBarcodeType::LEITCODE
FamilyPostal
Class\Com\Tecnick\Barcode\Type\Linear\Leitcode

Input

ItemValue
Character setdigits
Length13 digits, or 14 with a valid check digit
Checkmodulo 10 with weights 4 and 9, appended by the library
Extra parametersnone

Examples

A routing code

<?php

require_once __DIR__ . '/vendor/autoload.php';

$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
    type: 'LEITCODE',
    code: '2134807501640',
    width: -3,
    height: -30,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

Deutsche Post Leitcode barcode encoding 2134807501640

Errors

These payloads raise \Com\Tecnick\Barcode\Exception:

PayloadMessage
213480750164011The code must be 13 digits without the check digit or 14 with it, 15 given

See Also