rahofmann - 2015-09-17

Hi,
Is there a possibility to read out the page number where zbarimg located
the barcode(s)? This could be used for splitting the docs using tiffcp.

I've a stack of barcoded documents, which are scanned in one go to a
multipage tiff file. One document starts at the barcoded page followed
by pages up to the next barcoded page.
Now I've to split up this file again to single documents with filenames
containing the barcode. If there is more than one barcode detected on
one page, it has to result in copies of the single document with
filenames containing different barcodes.

doc11 (barcode1, barcode2, barcode3)
doc12
doc13
doc21 (barcode4)
doc22
doc31(barcode5, barcode6)
doc32
doc33

result should be:

doc11-13 > barcode1.pdf, barcode2.pdf, barcode3.pdf

doc21-22 > barcode4.pdf

doc31-33 > barcode5.pdf, barcode6.pdf

Using zbarimg I got a solution for a single document scanned as multi
page tiff:

!/bin/bash

zeilen=""
zbarimg --raw $1 > barcode.txt
zeilen=cut -d " " -f1 ./barcode.txt
for i in $zeilen;
do
tiff2pdf -t "KD-Schreiben zu $i" -o $i.pdf $1;
done
rm ./barcode.txt
mv $1 ./sic
exit 0

Kind regards
Rainer