Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >

Using Barcodes for More Effective Document Management

Barcodes have been used commercially since the mid-1970s. While they are commonly known for use in retail or warehousing, today barcodes are also widely used in document management. In the field of document management, typical usage includes

Here are some of the common practical uses of barcodes and we can see how Dynamic Web TWAIN SDK can benefit your business workflow.

Split

When dealing with batch documents, barcodes can function as a smart separator, or to properly group documents. For example, by affixing a barcode to each document in a batch and then scanning it, the files can be automatically grouped or separated. They can be automatically made into multi-page TIFF or PDF files. All of this can be accomplished with a single batch scan.

Split a large file on a barcode separator

split

As illustrated above, we can build a data capture system, being a web application, a Windows service or desktop application, which can automatically read barcodes on a file. Whenever a barcode is detected, a new file is created, with the barcode value as the file name, just like this customer wants it:

We have a need to a SDK that we can use in our automated internal solution that will pick up PDF files from a network share and then split out pages from the PDF based on reading of a barcode. For example, we could have a 10 page PDF. On page 1 is a barcode with a value of File001 and on page 5 is another barcode of File002. Using the SDK, we would like to split the single PDF into 2 documents: Pages 1-4 and 5-10.

Split documents using the barcode separator

scan-and-split

Below is a code snippet to read all documents and use those with barcodes to separate them into different documents. You can also try to split your document by barcode in this online demo.

// `aryIndices` consists of multiple arrays each of which represents a document
var aryIndices = [],
    bBarcodeFound = false,
    ProcssedImagesCount = 0;
j;
function ReadBarcode(index) {
    DWObject.Addon.BarcodeReader.decode(index)
        .then(function(results) {
                ProcssedImagesCount++;
                if (results.length === 0) {
                    console.log('no barcode found on image index ' + index);
                    if (bBarcodeFound === true) {
                        // If a barcode was found earlier, this image belongs to the current document
                        bBarcodeFound = false;
                        if (aryIndices.length === 0)
                            aryIndices.push([index]);
                        else
                            aryIndices[aryIndices.length - 1].push(index);
                    } else {
                        // If no barcode has been found yet, this image belongs to the first document
                        if (aryIndices.length === 0)
                            aryIndices.push([index]);
                        else
                            aryIndices[aryIndices.length - 1].push(index);
                    }
                } else {
                    console.log('barcode found on image index ' + index);
                    if (ProcssedImagesCount === DWObject.HowManyImagesInBuffer) {
                        //If it is the last image, no need to set this flag to true nor create a new document
                        bBarcodeFound = false;
                    } else {
                        bBarcodeFound = true;
                        // Found a barcode, create a new one
                        if (aryIndices.length === 0)
                            aryIndices.push([]);
                        else if (aryIndices[aryIndices.length - 1].length != 0)
                            aryIndices.push([]);
                    }
                }
                if (ProcssedImagesCount === DWObject.HowManyImagesInBuffer) {
                    // Print out the indice arrays, each array represents a document
                    console.log(aryIndices);
                    aryIndices = [];
                } else
                    /*
                     * Read the next image
                     */
                    ReadBarcode(index + 1);
            },
            function(errorMsg) {
                console.log(errorMsg);
            }
        );
}
ReadBarcode(0);

Classify / Route

Categorize documents using the barcode separator

classify

Barcodes can also be used in file routing. Barcodes are detected and used to determine the target path within a computer’s file system. If the path does not exist, a new folder can be created. This is particularly helpful to automatically group thousands of files based on the document type, such as invoices for different vendors.

Categorize scanned documents using barcode identification

scan-and-save-using-barcode

Auto-classification can also be used along with document scanning. Barcodes help identify the type of documents being scanned. Data capture systems can look at the content of the barcodes to determine the appropriate procedures to implement next. We can either move all files of one type to a specific folder or save them as a multi-page TIFF/PDF file.

The following code reads all barcodes from all documents and puts documents which have the same barcode into one document. Documents without any barcodes are put into another separate document. You can try to categorize your document by barcode in this online demo.

// `aryIndices` consists of multiple arrays each of which represents a document
var aryIndices = {
        'noBarcode': []
    },
    ProcssedImagesCount = 0;

function ReadBarcode(index) {
    var j,
        bBarcodeFound = false;
    DWObject.Addon.BarcodeReader.decode(index).then(function(results) {
            ProcssedImagesCount++;
            if (results.length === 0) {
                console.log('no barcode found on image index ' + index);
                aryIndices.noBarcode.push(index);
            } else {
                console.log('barcode found on image index ' + index);
                var barcodeOnThisImage = [],
                    allKeys = [];
                for (j = 0; j < results.length; j++) {
                    var result = results[j];
                    var barcodeText = result.barcodeText;
                    // Record all barcodes found on this image
                    if (barcodeOnThisImage.indexOf(barcodeText) === -1)
                        barcodeOnThisImage.push(barcodeText);
                }

                Dynamsoft.Lib.each(aryIndices, function(value, key) {
                    allKeys.push(key);
                });

                for (j = 0; j < allKeys.length; j++) {
                    var oKey = allKeys[j];
                    if (barcodeOnThisImage.indexOf(oKey) != -1) {
                        barcodeOnThisImage.splice(barcodeOnThisImage.indexOf(oKey), 1);
                        var _value = aryIndices[oKey];
                        if (_value.indexOf(index) === -1) {
                            _value.push(index);
                            aryIndices[oKey] = _value;
                        }
                    }
                }
                for (j = 0; j < barcodeOnThisImage.length; j++) {
                    aryIndices[barcodeOnThisImage[j]] = [index];
                }
            }
            if (ProcssedImagesCount === DWObject.HowManyImagesInBuffer) {
                ProcssedImagesCount = 0;
                var aryTemp = [];
                Dynamsoft.Lib.each(aryIndices, function(value, key) {
                    aryTemp.push(value);
                });
                aryIndices = aryTemp;
                console.log(aryIndices);
                aryIndices = {
                    'noBarcode': []
                };
            } else
                /*
                 * Read the next image
                 */
                ReadBarcode(index + 1);

        },
        function(errorMsg) {
            console.log(errorMsg);
        }
    );
}
ReadBarcode(0);

Automatic File Renaming

Rename documents using the value of barcode

You can automate renaming of files to associate them with other items, such as another file to match. In many cases, the first page of a file has a barcode encoded with meaningful info. For example, a patient’s chart might have his or her ID on it. This removes an otherwise tedious user task, especially when you deal with a lot of documents.

rename

Case Study

This was the case for the German Red Cross’s accounting department. They deal with a lot of invoices and wanted to automate much of the workflow. With barcodes, they were able to achieve that. When an invoice is received they put a label with an identifier barcode on the document. It is then scanned with Dynamsoft Barcode Reader. Upon scanning, the invoice is automatically renamed with the barcode value for simpler tracking. The invoice can then go to the treasurer and online bank for payment processing. The renamed PDF helps the treasurer relate the invoice to information returned from the bank, to properly record transactions. After payment processing, the entire transaction flow is recorded to the database for record keeping. The treasurer can then see the detailed transaction information from the online accounting system.

Index

Another common use of barcodes is to contain metadata or indexing information intended for document management systems. After the barcode is detected, the value can be compared against some data, possibly a key identifier, from the database, and then the next step can be decided. Sometimes the newly scanned documents are associated with the record in the database. For example, a small software development consultancy based on the US East coast has a healthcare practice client using an application to scan and manage patient records. The medical users previously had to do the following steps to manage patient records:

  1. Place one document or patient record at a time in the scanner
  2. Select the correct patient
  3. Select the correct document type
  4. Type a description
  5. Finally, press scan button and then save the files

They then introduced QR codes to their document workflow and it saves time on the previous manual data entry. Now they:

  1. Print documents with an encoded QR code or attach a QR-coded label that includes the data of a record number and document type.
  2. With the QR code put on the first page of a document, during scanning, the barcode reader automatically determines the correct patient ID and document type and any scanned documents then automatically go to corresponding locations.

Read more on this topic: Automate document indexing with barcodes

Dynamsoft Barcode and Imaging SDKs

Dynamsoft provides complete solutions for document capture, barcode reading, and more. These SDKs empower developers with a one-stop shop for comprehensive document management applications that work across software and hardware platforms:  desktop, mobile, desktop scanners, webcams, smartphones, Android, iOS, Linux and Windows.

Dynamsoft’s SDKs which facilities development of such intelligent data capture systems,

  • Dynamic Web TWAIN is a browser-based SDK for document scanning.
  • Dynamic .NET TWAIN is a .NET document imaging SDK based on the TWAIN and DirectShow standards.
  • Dynamsoft Barcode Reader SDK enables you to efficiently embed barcode reading functionality in your web, desktop, and mobile application using just a few lines of codes.

If you’re looking for assistance in integrating scanning/capture, barcodes or other document management features into your business’ workflow or applications, please contact us.

Sample code and demo:

Subscribe Newsletter

Subscribe to our mailing list to get the monthly update.

Subscribename@email.com