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. To some extent, barcode is a special format of text. It can encode various kinds of information, like a website URL, a patient’s ID number, the delivery address for a package, etc. Thus, extracting data from a barcode plays a big role in automating business processes. They remove the need for time-consuming manual work. They also minimize the chances for human errors.

In the field of document management, typical usage includes splitting, renaming, indexing, and routing. Working together with low-cost scanners, barcode decoding can be used to build an intelligent data capture system that seamlessly fits your business workflow.

Here are some of the common practical uses of barcodes.


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


As illustrated above, we can build a data capture system, being a Windows service, a web application 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 .NET 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 scanned documents using barcode separator sheets


Below is a code snippet to scan a stack of paper documents and perform splitting during the scanning process. This can be implemented using the OnPostTransfer event which fires after each page scanning:

private void dynamicDotNetTwain1_OnPostTransfer()
if (dynamicDotNetTwain1.ErrorCode == 0)
reader.DecodeBitmapRect((Bitmap)(dynamicDotNetTwain1.GetImage(this.dynamicDotNetTwain1.CurrentImageIndexInBuffer)), rect);
//next steps

If necessary, we can define the system to act only when a specific splitting text is identified, ignoring other unwanted barcode strings.

Classify / Route

Categorize documents using the barcode separator


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


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.

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.


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’s 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.


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 to 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 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/

[Case Study] How to Automate Document Indexing With Barcodes

Dynamsoft Barcode and Imaging SDKs

Dynamsoft provides complete solutions for document capture, barcode reading, optical character recognition, 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 .NET TWAIN is a .NET document imaging SDK based on the TWAIN and DirectShow standards.
  • Dynamic Web TWAIN is a browser-based SDK for document scanning.
  • Dynamsoft’s Barcode Reader SDK enables you to efficiently embed barcode reading functionality in your web, desktop and mobile application using just a few lines of code.

With Dynamsoft Barcode Reader SDK, developers have very flexible barcode reading settings. End users can decode barcodes from various image file formats (BMP, JPG, PNG, PDF, and TIFF) or video live streams. This includes from device-independent bitmap (DIB) formats which can be obtained from cameras or scanners.

The SDK lets developers specify settings like expected barcode count, the barcode region, and more to further increase barcode scanning efficiency.

The company provides 30-day free trials for all SDKs. If you’re looking for assistance in integrating scanning/capture, barcodes, OCR or other document management features into your business’ workflow or applications, please contact us.

Barcode sample code:

Subscribe Newsletter

Subscribe to our mailing list to get the monthly update.