|
The barcode decoding feature of HylaFAX Enterprise Edition can help automate fax routing. Below are a few examples of
possible ways to use barcode decoding. Please reference the following fax images for these examples.
|
|
| Page 1 |
Page 2 |
|
|
| Page 3 |
Page 4 |
Decoding a large barcode
Since this fax contains fairly large barcodes (on 3 of the 4 pages), we can use HylaFAX Enterprise Edition's default settings.
Running:
$ bardecode -t any -m fax001335361.tif
Returns:
1-SM-1398
1-SM-1402
11347
The entire fax is scanned and, in this example, three barcodes were detected and outputted.
Detecting the page that contains the barcode
By adding the -P flag to the above example, HylaFAX Enterprise Edition will output the page number where the barcode is located.
Running:
$ bardecode -P -t any -m fax001335361.tif
Returns:
1:1-SM-1398
3:1-SM-1402
4:11347
Three barcodes were detected and outputted with the
corresponding page number. For example, barcode 1-SM-1398 was found on
page 1.
Creating new TIFF files for each barcode
While scanning a fax, each time HylaFAX Enterprise finds a
barcode, it will create a new tiff file. This is described in more
detail in the commandline help:
-S file_template: Split a multi-page TIF file into smaller TIF files.
The first page of each new file will contain a
barcode. The template must include %d to index the
files e.g. file%d.tif. Must be used with -m flag.
So using that on the previous tiff file:
$ bardecode -t any -m -S fax001337296_%d.tif
We now see:
$ ls -al fax001337296*.tif
rw-rw-r-- 1 fax fax 36908 Aug 24 23:00 fax001337296_1.tif
-rw-rw-r-- 1 fax fax 29670 Aug 24 23:00 fax001337296_2.tif
-rw-rw-r-- 1 fax fax 27488 Aug 24 23:00 fax001337296_3.tif
-rw-rw-r-- 1 fax fax 94154 Aug 24 22:40 fax001337296.tif
Decoding a small or poor-quality barcode
It is possible to use the commandline to change the way the fax
image is scanned by the decoder. By default the scanner jumps
9 lines at a time, and samples coarsely. This is optimized for
performance,
but not very effective at detecting marginal barcodes. Also, in this
example the barcodes on the fax are not very tall; 9 lines are too many
to jump. By using the -j argument we can tell HylaFAX Enterprise to
jump 2 lines instead of the standard 9. This will produce a finer scan
of the image, enabling us to detect a smaller barcode.
Running:
$ bardecode -j 2 -t any -m fax001333235.tif
Returns:
1-I1323
The finer decoding was successfull where the default option would not have been able to decode the fax.
Using bardecode on incoming faxes
The fax receive script (bash shell script) can invoke bardecode,
take the codes and name the split tiff files if necesary. This script
can be customized to your specific situation, keeping in mind both
faxes with and without barcodes.
|