GS1-14

GS1-14 barcode in PHP: 14 digit GTIN input, check digit, code example and SVG output

The same GTIN-14 that ITF-14 carries, drawn as a GS1-128 with Application Identifier 01 instead. Also catalogued as EAN-14 and SCC-14. Pass the digits and the library writes the element string.

Type Token

ItemValue
Type tokenGS114
Enum caseBarcodeType::GS114
FamilyLinear
StandardGS1 General Specifications
Class\Com\Tecnick\Barcode\Type\Linear\GsOneOneFour

Input

ItemValue
Character setdigits
Length13 digits, or 14 with a valid check digit
Checkmodulo 10, appended when the payload is 13 digits and verified when it is 14
Extra parametersnone

Examples

A GTIN-14

<?php

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

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

echo $bobj->getInlineSvgCode();

GS1-14 barcode encoding 9501101020917

Errors

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

PayloadMessage
950110102091AInput code must be a number

See Also