Text property
The Text property represents the barcode data in a human-readable format.
2D barcodes (PDF417, QR, DataMatrix) may contain both textual data in various languages as well as binary data. To recover the most accurate and relevant barcode values from the barcode in the Text property ClearImage readers employ a combination of the several techniques:
- Decompresses data that was previously compressed by Adobe® LiveCycle® or Inlite’s Barcodes-For-Documents (BFD)
- Detect ECI and Unicode indicators to derive the language-specific text.
- Makes XML data stored in the barcode more readable with the appropriate level of indentation
- Present the data from Driver Licenses, ID Cards and Military CAC cards in a uniform XML format (requires ClearImage DL/ID Reader license)
- Reconstructs a single, integrated value form from multiple Structured Append barcodes (including Macro PDF417) .
Notes:
- Adobe ® and LiveCycle ® are trademarks of Adobe Systems Incorporated.
- Each of the presentation features can be selectively disabled in the Inlite Control Center -> Versions tab -> Configuration dialog box.
Data property
The Data property returns a byte array with the original, unprocessed binary data that was stored in the barcode. As with any binary file, the application must be aware of stored data format in order to properly interpret the data.
Language-specific Character Sets
Most 1D barcodes encode subset of ASCII character set.. Code128 extends encoding to ISO-8859-1 character set by using the special symbol FNC4.
2D barcodes (PDF417, DataMatrix, QR), on the other hand, are capable of encoding text in any language.
Barcode generators employ various methods listed below to accomplish this.
ClearImage detects which of the following methods has been used and automatically decodes text. The Text property contains language-specific (e.g. Arabic, Chinese, Hebrew, Hindi, Japanese, Russian etc.) value in UTF-16LE format
- Extended Channel Interpretation (ECI) embeds a language identification in barcode data (see AIM Standard)
- Unicode text as UTF-8 (with or without BOM) or UTF-16 with BOM
- Kanji encoding in QR Code.
Alternatively your application or your language-specific barcode generator can encode text using your language code page or as UTF-16 without BOM. In this case, your application can decode text from Data property. Code examples are:
C#
1
string text = System.Text.Encoding.GetEncoding(1251).GetString(bc.Data);
VB
1
Dim text As String = System.Text.Encoding.GetEncoding(1251).GetString(bc.Data)
Java
1
String text = new String(Bc.getData(), Charset.forName("windows-1251"));
Structured Append / Macro PDF417
Structured Append (or SA) mode is special mode defined by PDF417, DataMatrix and QR standards to encode large amount of text or binary data into multiple barcodes (SA segments). In PDF417 standard this mode is called Macro PDF417. ClearImage processes SA segments according to the corresponding standards as well as AIM ECI standard in buffered and unbuffered modes.
Buffered mode
In buffered mode:
- A single barcode value reconstructed from multiple consecutive SA segments.
- Barcode’s Meta data contains details about individual SA segments information.
- Note: If not all SA segments are present or some segments failed to read, then a partial barcode value is reconstructed from consecutive SA segments.
To obtain barcode values in buffered mode:
- CiPdf417, CiDataMatrix and CiQR classes of COM API or .NET API Inlite.ClearImage namespace
- use Find (0) method read barcodes on a page.
- .NET API .Inlite.ClearImageNet namespace.
- set BarcodeReader.MaxBarcodes = 0 (note: zero is a default value. No need to initialize explicitly)
- use BarcodeReader.Read (filename, page) to reconstruct SA value from the SA segments on a single page
- use BarcodeReader.Read (filename) to reconstruct SA value from the SA segments on all pages in a file.
Unbuffered mode
In unbuffered mode:
- Each SA segment’s barcode value is returned separately.
- As required by standards Text and Data properties start with:
- Symbology identifier: 3-chracters sequence starting with ] character
- .Macro Control Block: sequence starting with \MI and ending \MY
- Barcodes’s Meta data contains the SA information for this segment.
- Note: Each segment is decoded separately. Therefore ECI encoding that starts in a previous segments would not be applied to the current segment.
To obtain barcode values in unbuffered mode:
- CiPdf417, CiDataMatrix and CiQR classes of COM API or .NET API Inlite.ClearImage namespace
- use FirstBarcode () / NextBarcode () methods
- use Find (maxBarcodes) where maxBarcodes is not 0.
- .NET API .Inlite.ClearImageNet namespace.
- set BarcodeReader.MaxBarcodes = N where N > 0
- use one of the BarcodeReader.Read (…) method
To force unbuffered mode for all ClearImage calls:
- Start the Inlite Control Center. Select Versions tab. Click Configuration button
- Select Barcode Text Value tab. Set Structured Append to false
Meta data
Meta data is the information in XML format that describes various properties of barcode, such as PDF417 rows/columns/ECC level, language-specific code pages, ECI codes, Structured Append information.
To obtain Meta data:
C#
1
string sMeta = oBarcode.Decode((BarcodeDecoding)102);
C++
1
std::wstring wsMeta = objCiBarcode->GetInfo(L"meta");
VB/ASP
1
sMeta = oCiBarcode.Info("meta")
Other barcode properties
Other elements of information associated with the barcode are available to the user application:
Property | Description |
Type | Barcode symbology. This value is typically used to filter the barcode of interest when multiple barcodes are present on a page or in the file. |
Length | Number of bytes representing barcode value in Data property. . |
Rectangle | Location of barcode on a page. This value is typically used to filter barcode of interest when multiple barcodes are present on a page. |
Rotation | Barcode rotation relative to the page image. This value may identify page scanning orientation. For example, if you know that the barcode is printed horizontally on the page, then an “upside down” barcode rotation indicates that the page was scanned upside-down. You can use the ClearImage Rotate method to correct the image. |
ModuleSize | Average width (in pixels) of the barcode modules. This value is important for tuning the barcode creation and scanning process. To optimize performance it is recommended that for 1D barcodes and PDF417 this value be in the range of 3 to 10 pixels, while for DataMatrix and QR from 5 to 15 pixels. |
File | Name of the file containing barcode (.NET API only) |
Page | Page number containing barcode (.NET API only) |