Using GS1 Definitions for Application Identifiers
TBarCode Library uses the GS1 Barcode Syntax Dictionary when generating barcodes
that contain GS1 Application Identifiers. TBarCode SDK includes the definition
file gs1-syntax-dictionary.txt, and TBarCode Library loads it automatically
from the standard configuration directory.
Configuring the Definition File Location
In a standard installation, TBarCode SDK installs
gs1-syntax-dictionary.txt in the configuration directory returned by
BCGetConfigurationDir().
- On Windows, the
TECIT_TBCSDK_CONFIGURATION_PATHenvironment variable specifies this directory. - On Linux and UNIX, the default configuration directory is
/usr/local/share/tbarcode11. - On macOS, the default configuration directory is the
Resourcesdirectory of the installed TBarCode framework.
To use a different definition file or location:
- Call
BCInitGs1()and pass either the full path to the definition file or the directory containing it. - On Windows, you can alternatively set
TECIT_TBCSDK_CONFIGURATION_PATHto another directory before starting the application.
On platforms that require BCInitLibrary(), call BCInitGs1() afterwards.
Check the return code:
ERRCODE LoadGs1Definitions(LPCTSTR definitionsPath)
{
ERRCODE eCode = BCInitGs1(definitionsPath);
if (eCode != ErrOk) {
// Loading failed; no GS1 definitions are active.
return eCode;
}
// The loaded file replaces the previous GS1 definitions.
return ErrOk;
}
Updating the Definition File
If the installed GS1 definitions are no longer current or the application needs newer definitions provided by GS1, update the definition file as follows:
- Download the current
gs1-syntax-dictionary.txtfrom the official GS1 Barcode Syntax Resource. - Choose how the updated file should be loaded:
- Automatically: Replace the installed file in the configured directory, and then restart the application. TBarCode Library loads the updated file automatically.
- Explicitly: Pass either the full path to the downloaded file or the
path to its containing directory to
BCInitGs1(). Check that the function succeeds.