DocumentBarcodes Object

Summary

Manages the global barcodes settings for the document.

Syntax

JavaScript Syntax
function lt.Documents.DocumentBarcodes 
TypeScript Syntax
class lt.Documents.DocumentBarcodes() 

Remarks

DocumentBarcodes manages the global barcodes settings of the document. It can be accessed through the Barcodes property of Document.

For more information, refer to Barcode processing with the Documents Library.

Example

This example shows how to read the barcodes from a TIFF file.

Start with the example in Document and replace the example function call to the function below.

JavaScript Example
function barcodesExample() { 
   // Load a new document 
   var url = "https://demo.leadtools.com/images/tiff/barcode.tif"; 
   console.log("Loading document ..."); 
   var loadDocumentOptions = new lt.Documents.LoadDocumentOptions(); 
   lt.Documents.DocumentFactory.loadFromUri(url, loadDocumentOptions) 
       .done(function (doc) { 
          console.log("Done. Reading barcodes ..."); 
          // Read all the barcodes in the first page 
          var docPage = doc.pages.item(0); 
          docPage.readBarcodes(lt.LeadRectD.empty, 0, null) 
              .done(function (barcodes) { 
                 console.log("Number of barcodes read " + barcodes.length); 
                 for (var i = 0; i < barcodes.length; i++) { 
                    var barcodeData = barcodes[i]; 
                    console.log("  Symbology:" + barcodeData.symbology); 
                    console.log("  Bounds:" + barcodeData.bounds.x + "," + barcodeData.bounds.y + "," + barcodeData.bounds.width + "," + barcodeData.bounds.height); 
                    console.log("  Value:" + barcodeData.value); 
                 } 
              }) 
              .fail(function (jqXHR, statusText, errorThrown) { 
                 showServiceError(jqXHR, statusText, errorThrown); 
              }); 
       }) 
       .fail(function (jqXHR, statusText, errorThrown) { 
          showServiceError(jqXHR, statusText, errorThrown); 
       }); 
} 

Requirements

Target Platforms

Help Version 19.0.2017.10.18
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Documents Assembly