Barcode detection
Requirements for barcode detection
Barcode detection is an optional step when importing documents of the following types:
Image files
PDF files containing images of barcodes
Barcode detection depends on images of sufficient quality. Contrast, sharpness and resolution are possible limiting factors.
Sometimes, certain parts of an image are 'detected' as barcodes by mistake. The risk of such 'phantom detections' can be minimized by defining positive criteria for 'acceptable' or' real' barcodes as Barcode filters (see 'Settings ...' below).
Objectives for barcode detection
Barcode detection during file upload can be user for the following purposes (selectively or in combination):
Acquiring reference parameters for automatic assignments of content to data objects (see Assigning documents)
Splitting multi-page documents into single documents to reference individually
Settings for barcode detection
During an interactive document import, 'Barcode detection' (in the document overview) opens a sub dialog featuring specific Preferences (1). Clicking Scan (2) runs the detection process for the uploaded file with the active settings.
For Importing documents via Lobster_data with barcode detection, a preprocessor (doc:BarcodeDocument (Preprocessor)) provides fields resembling these settings. The processing logic applies as shown below.
Barcode filters
Barcode filters qualify which of the barcodes detected in a file should be processed further. If no barcode filters are defined, all detected barcodes are processed.
Each barcode filter may specify the Format of the barcode and a regular expression (RegEx). Both criteria are optional and handled as a conjunction (AND), if applied within the same barcode filter.
Multiple barcode filters are interpreted as a disjunction (OR). A detected barcode will be processed, if it matches all criteria of at least one filter.
In the example above, the combination of barcode filters will accept EAN-8 barcodes as well as Code-128 barcodes, which are terminated by a sequence of exactly eight numeric digits.
Barcode pattern
With or without a barcode pattern definition, the reference property of the current document will always be initialized by all characters of a barcode being processed.
A Barcode pattern defines an interpretation schema for the string derived from a barcode by a an alternating sequence of plain text (e.g. separator) characters and placeholders for substrings to be copied to document properties.
Each placeholder must indicate the internal name of a document property wrapped in curly brackets and with matching case.
Using {reference} as a placeholder will override the initialization of the reference property with the complete barcode string.
►NOTE◄ If the barcode pattern does not contain {reference} as a placeholder or is not completely applicable to the structure of a barcode string, the default reference with the full barcode string remains valid.
Examples:
Example |
Barcode pattern |
Sample barcode |
Document-Properties |
Remarks |
1 |
empty |
|
Reference: reference = "USER-1234" |
initial value (no pattern) |
2 |
{reference} |
|
Reference: reference = "USER-1234" |
pattern resolves to initial value |
3 |
USER-{reference}
|
|
Reference: reference = "1234" |
prefix 'USER-' is omitted from the string, because it is included as plain text in the pattern |
4 |
|
Reference: reference = "USER1234" |
initial value (pattern not matching, minus character is missing) |
|
5 |
{referenceType}-{reference} |
|
Reference: reference = "1234" |
Document reference type with internal name 'USER' must exist! |
6 |
{documentType}-{name} |
|
Reference: reference = "USER-1234" |
initial value (pattern without placeholder {reference}) Document type with internal name 'USER' must exist! |
7 |
{referenceType}-{documentType}-{name} |
|
Reference: reference = "USER-1234" |
initial value (pattern not matching) |
A combination of placeholders, as in example no. 6 ({referenceType}-{reference}), can be used to dynamically address a specific Document reference type per barcode (e.g. 'USER-1234' or 'MFST-515'). This choice defines how a given reference is processed to find a target data object to assign the document to. Ultimately, the content of the barcode may control which type of entity is referenced to assign the document.
Splitting a multi-page document
If an uploaded document contains multiple barcodes relevant for processing according to Barcode filters, the default process without the option Split document? will create a copy of the document for each barcode and reference it individually. If successful, identical content will be assigned to different data objects and stored redundantly.
Checking the option Split document? changes this process, by saving and assigning only a segment of the document per barcode.
The option Skip barcode page? is only effective, when Split document? is checked. It defines which pages of the document appear per section:
Without the option Skip barcode page? each section starts with the page containing the current barcode and ends before the page containing the next barcode or the end of the document.
With the option Skip barcode page? each section starts with the page following the one containing the current barcode and ends before the page containing the next barcode or the end of the document.
►NOTE◄
If the option Skip barcode page? is checked, at least one page without a barcode should follow each page with a barcode. Otherwise, the page with the barcode is saved and assigned as a document.
If the option Skip barcode page? is checked and more than one relevant barcodes are detected on the same page, the following section is duplicated and referenced for each barcode.
To identify the document for a section, the number of the page (starting from 0) containing the relevant barcode in the original document is suffixed to the name entered in the original document.