Compact PDF417

Compact PDF417 barcode in PHP: truncated symbol, aspect ratio, code example and SVG output

Dropping the right row indicator and shortening the stop pattern takes about two codewords off every row. It is meant for clean printing on a controlled surface, where the redundancy it gives up was not going to be missed.

Type Token

ItemValue
Type tokenPDF417C
Enum caseBarcodeType::PDF417C
Family2D
StandardISO/IEC 15438
Class\Com\Tecnick\Barcode\Type\Square\PdfFourOneSevenCompact

Input

ItemValue
Character setany byte sequence
Lengthas PDF417, in a narrower symbol
CheckReed-Solomon error correction at the chosen level
Extra parameters3 (see below)

Extra Parameters

Appended to the type token after commas, as in PDF417C,2,5.

PositionMeaningValuesDefault
1aspect ratioa number not less than 12
2error correction level0 to 8automatic
3macro block parameterssegment index, file id and optionsunset

Examples

The same digits as the full form, in less width

<?php

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

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

echo $bobj->getInlineSvgCode();

Compact PDF417 barcode encoding 0123456789

Errors

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

PayloadMessage
``Empty input

See Also