Web API Barcode Reader (WaBR)

Overview

Web API Barcode Reader (WaBR) extends Inlite’s ClearImage barcode recognition technology to cloud-based imaging applications.

WaBR Server implements server-side RESTful API for barcode reading.
It is pre-configured Web site, licensed by Inlite, for deployment on a customer-owned Windows Server with IIS

Step-by-Step

1- Install WaBR Server and Evaluation license

2 – Test your images on the WaBR Server

  • Go to WaBR Server test page http://localhost/wabr
  • Use the file or url as image source to read barcodes from your images. Start with sample image listed below.
  • If WaBR fails to read your barcode try, try uploading your image to Inlite’s Online Barcode Reader.  If that reader succeeds, then set the tbr field to value 103, and read again. .
    If the barcode is still unreadable or you want read barcodes faster or you have any other questions send the image file or image URL to support@inliteresearch.com and we will advise further.

3 – Develop client-side code or use Command Line EXE

  • Use JavaScript sample or one of client SDK ( .NET, Java, Node JS, PHP, Python and Ruby) to develop your client side code. Each SDK comes with source code that can be adopted to your requirements.
  • Send requests to your WaBR Server endpoint

Alternatively use BarcodeReaderCL.exe. This is a Windows command line application client to any WaBR Server. Download BarcodeReaderCL.zip from here.

4 – Start Production use

  • Purchase a WaBR Server License   and the appropriate SDK Server License (1D, 2D, 1D+2D, or DL/ID)
  • Install ClearImage PDK and register the purchased product certificates (both will be supplied in an e-mail after the purchase)
  • Restart IIS Server

WaBR API

Endpoints

The following endpoints read barcodes from various sources. All optional reader parameters can be used with each endpoint.

/barcodes POST request using any combination of url, file and image parameters as an image source
/barcodes/url GET request using url parameter as an image source
/barcodes/file POST request using file parameter as an image source
/barcodes/base64 POST request using image parameter as an image source

Image source parameters

At least one image source should be specified. Most popular image formats are acceptable as image source, including PDFTIFJPEG etc. Multi-page PDF and TIF files are supported

url – URL of an image file. The name should start with http:// , https:// or file://. Examples:

https://wabr.inliteresearch.com/SampleImages/1d.pdf  
https://upload.wikimedia.org/wikipedia/commons/0/07/Better_Sample_PDF417.png 
url value supplied as query parameter if GET request should be url-encoded. (e.g. use encodeURIComponent() in JavaScript)

file – Local file supplied in POST request .   JavaScript examples:

formData.append('file[]', "\\COMPUTER_NAME\another_folder\another_file.pdf","another_file.pdf");
formData.append('file[]', "c:/image_folder/some_image_file.tif","some_image_file.tif")

image – Base64-encoded string representing content of an image file.   Example:

data:application/pdf;base64,WTTVKM3OWFKFMERCMT5... :::IMAGE_FILE.PDF 
Format :
[data:[MIME-type][;base64],]content[:::filename] 

Only content, representing file content encoded as base64, is required. The values in [ ] are optional. The values in italic are variables.
MIME-type identifies file format. e.g. application/pdf or image/tiff. The value is only for compatibility with data URI scheme. The barcode reader will automatically identify file format based on data in content

Optional reader parameters

String parameters are not case-sensitive and might contain the list of comma-separated values. If parameter not specified, default value is used.

types - Barcode types to read. Default value is  1d, 2d. Valid values are:

1dsame as code39, code128, code93, ucc128, codabar, interleaved2of5, upca, upce, ean8, ean13
code39Code 39 Full ASCII
code128Code 128
code93Code 93
codabarCodabar
ucc128GS1-128
interleaved2of5 Interleaved 2 of 5
ean13EAN-13
ean8EAN-8
upcaUPC-A
upceUPC-E
2dsame as pdf417, datamatrix, qr
pdf417PDF417 code
datamatrixDataMatrix code
qrQR code
drvlicDriver License, ID Cards and military CAC ID
postalsame as imb, bpo, aust, sing, postnet
imbUS Post Intelligent Mail Barcode
bpoUK Royal Mail barcode (RM4SCC)
austAustralia Post barcode
singSingapore Post barcode 
postnetPostnet, Planet
code39basicCode 39 Basic
patchPatch code

format -  Identifies output format. Default value is json. Valid values:

xmlXML-formatted result
json JSON-formatted result (default)

fields -  Identifies elements of barcode information present in output. Default: value is all fields except meta. Valid values:

textBarcode value as text (UTF-8 formatted)
dataUn-formatted barcode value as Base64 string. This value should be used to obtain binary content of barcode.
valuesList of values obtain after parsing barcode content. For example Driver License fields
lengthLength of un-formatted barcode value
typeBarcode type (also called symbology)
rectanglePosition of barcode on a page (in pixels)
rotationBarcode orientation
fileName of the file
pagePage number in a file
metaTechnical information about barcode

options -  Additional options: Default: no options

horzread only horizontal barcodes.
vertread only vertical barcodes.
inforeturn additional information about WaBR server

tbr -  Target Barcode Reader code(s). Default: no TBR code

TBR should be used only if WaBR fails to read your barcode. Try tbr value 103 (used by Inlite’s Online Barcode Reader).  If your barcode is still unreadable, you want read barcodes faster or you have any other questions send the image file or image URL to support@inliteresearch.com and we will advise further.

JavaScript WaBR example

The following examples demonstrate the basic techniques to read barcodes from an image file or URL page. Try it here

Sample Images

In order to simplify your rapid WaBR evaluation, development, deployment and testing Inlite provides a set of sample Images (see list below) with multiple symbologies and content. The images can be used from either your client-side code or from the Inlite Test Web Page.
The same images are included in your Web Server installation Kit to facilitate testing in your secure environment.

  • To test a URL, include the link in your GET or POST request
  • To test a file or base64 upload, first download the images to your client, then use them in the POST request.


https://www.dropbox.com/s/qcd8zfdvckwwdem/img39.pdf?dl=1
https://wabr.inliteresearch.com/SampleImages/1d.pdf
https://wabr.inliteresearch.com/SampleImages/2d.pdf
https://wabr.inliteresearch.com/SampleImages/postal.pdf
https://wabr.inliteresearch.com/SampleImages/drvlic.ca.jpg
https://wabr.inliteresearch.com/SampleImages/c39.multipage.tif
https://wabr.inliteresearch.com/SampleImages/I25.tbr132.jpg
https://wabr.inliteresearch.com/SampleImages/pdf417.adobe.pdf
https://wabr.inliteresearch.com/SampleImages/pdf417.utf8.pdf
https://wabr.inliteresearch.com/SampleImages/pdf417.ЙшзщЪфг_Russian.pdf
https://wabr.inliteresearch.com/SampleImages/pdf417.بساطة لأنه الأل_Arabic.pdf

Output Examples

Reading 1D barcode with with types set to code39,code128:

{
  "Barcodes": [
    {
      "Text": "Code 39",
      "Data": "Q29kZSAzOQ==",
      "Type": "Code39",
      "Length": 7,
      "Page": 1,
      "Rotation": "none",
      "Left": 895,
      "Top": 124,
      "Right": 1839,
      "Bottom": 384,
      "File": "https://wabr.inliteresearch.com/SampleImages/1d.pdf"
    },
    {
      "Text": "Code 128",
      "Data": "Q29kZSAxMjg=",
      "Type": "Code128",
      "Length": 8,
      "Page": 1,
      "Rotation": "none",
      "Left": 91,
      "Top": 128,
      "Right": 762,
      "Bottom": 388,
      "File": "https://wabr.inliteresearch.com/SampleImages/1d.pdf"
    }
  ]
}

Reading Pdf417 with UTF-8 encoded data with with types set to pdf417:

{
  "Barcodes": [
    {
      "Text": "Lorem Ipsum - это текст-\"рыба\", часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной \"рыбой\" для текстов на латинице с начала XVI века. В то время некий",
      "Data": "TG9yZW0gSXBzdW0gLSDRjdGC0L4g0YLQtdC60YHRgi0i0YDRi9Cx0LAiLCDRh9Cw0YHRgtC+INC40YHQv9C+0LvRjNC30YPQtdC80YvQuSDQsiDQv9C10YfQsNGC0Lgg0Lgg0LLRjdCxLdC00LjQt9Cw0LnQvdC1LiBMb3JlbSBJcHN1bSDRj9Cy0LvRj9C10YLRgdGPINGB0YLQsNC90LTQsNGA0YLQvdC+0LkgItGA0YvQsdC+0LkiINC00LvRjyDRgtC10LrRgdGC0L7QsiDQvdCwINC70LDRgtC40L3QuNGG0LUg0YEg0L3QsNGH0LDQu9CwIFhWSSDQstC10LrQsC4g0JIg0YLQviDQstGA0LXQvNGPINC90LXQutC40Lk=",
      "Type": "Pdf417",
      "Length": 290,
      "Page": 1,
      "Rotation": "none",
      "Left": 23,
      "Top": 21,
      "Right": 959,
      "Bottom": 523,
      "File": "https://wabr.inliteresearch.com/SampleImages/pdf417.ЙшзщЪфг_Russian.pdf"
    }
  ]
}

Reading driver license barcode with fields set to values:

{
  "Barcodes": [
    {
      "Values": {
        "AAMVA": {
          "last": "Sample",
          "first": "Samantha",
          "middle": "Jane",
          "dob": "1974-01-01",
          "eyes": "BLU",
          "hair": "BN",
          "sex": "F",
          "height": "5'7\"",
          "weight": "135 lbs",
          "street": "1801 W Jefferson St",
          "city": "Phoenix",
          "state": "AZ",
          "postal": "85007-3289",
          "id": "D01404860",
          "issued": "2001-06-28",
          "expires": "2039-01-01"
        }
      }
    }
  ]
}

Reading driver license barcode with fields set to values and format set to xml:

<Results xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Barcodes>      
     <Barcode>        
        <Values>          
           <AAMVA>         
              <last>Sample</last>
              <first>Susan</first>            
              <dob>1970-12-12</dob>            
              <eyes>BR</eyes>            
              <hair>BR</hair>            
              <sex>F</sex>            
              <height>5'11"</height> 
              <weight>121 lbs</weight>   
              <street>P.O. Box 1272 Room 2120</street>            
              <city>Little Rock</city>
              <state>AR</state>
              <postal>72205</postal>
              <id>999000680</id>
              <issued>2003-01-30</issued>
              <expires>2006-12-12</expires>
           </AAMVA>        
        </Values>            
     </Barcode>  
  </Barcodes>  
</Results>

WaBR Server System Requirements

  • OS:  Windows 7 or later, Windows Server 2008 or later.
    Preferred: Windows Server 2012 r2 or later
  • Architecture: x86 or x64
    Preferred: x64
  • CPU:  1GHz or faster
    Preferred: 3GHz or faster,  4 CORE
  • RAM Memory:  4GB or more
    Preferred: 8GB or more
  • IIS: v7.5 or later