PZN (Pharmazentralnummer)

PZN pharmaceutical barcode in PHP: input range, modulo 11 check digit, code example and SVG output

Pharmaceutical products in the German supply chain are identified by a Pharmazentralnummer, allocated by IFA GmbH. The library draws it as a CODE 39 symbol with the leading dash and the modulo 11 check digit that the PZN-8 scheme requires.

Type Token

ItemValue
Type tokenPZN
Enum caseBarcodeType::PZN
FamilyLinear
StandardIFA coding system, PZN-8
Class\Com\Tecnick\Barcode\Type\Linear\Pzn

Input

ItemValue
Character setdigits
Length7 digits, or 8 with a valid check digit
Checkmodulo 11, appended by the library
Extra parametersnone

Examples

A Pharmazentralnummer

<?php

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

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

echo $bobj->getInlineSvgCode();

PZN (Pharmazentralnummer) barcode encoding 2758089

Errors

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

PayloadMessage
275808AInput code must be a number
27580890Invalid check digit: 9

See Also