DocumentBarcodes Object

Summary

Manages the global barcodes settings for the document.

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

Remarks

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

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

Example

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

Start with the example from LEADDocument and replace all the code inside the example function (search for the "// TODO: add example code here" comment) with the following code:

TypeScript
JavaScript
var url = "https://demo.leadtools.com/images/tiff/barcodes.tif"; 
log("Loading document..."); 
lt.Document.DocumentFactory.loadFromUri(url, new lt.Document.LoadDocumentOptions()) 
   .done(function (doc) { 
 
      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) { 
            log("Number of barcodes read: " + barcodes.length + " (data in console)", barcodes); 
         }) 
         .fail(showServiceError); 
   }) 
   .fail(showServiceError); 
class LEADDocument_BarcodesExample { 
    public constructor() { 
        lt.RasterSupport.setLicenseUri("https://demo.leadtools.com/licenses/v200/LEADTOOLSEVAL.txt", "EVAL", null); 
    } 
 
    public run(buttonID: string) { 
        document.getElementById(buttonID).onclick = this.readBarcodes; 
    } 
 
    readBarcodes = () => { 
        const url = "https://demo.leadtools.com/images/tiff/barcodes.tif"; 
        const loadDocumentOptions = new lt.Document.LoadDocumentOptions(); 
 
        log("Loading document..."); 
        lt.Document.DocumentFactory.loadFromUri(url, loadDocumentOptions) 
            .done((document: lt.Document.LEADDocument) => { 
                log("Done. Reading barcodes..."); 
                // Read all the barcodes in the first page 
                const docPage = document.pages.item(0); 
                docPage.readBarcodes(lt.LeadRectD.empty, 0 , null) 
                    .done((barcodes) => { 
                        log("Number of barcodes read: " + barcodes.length + " (data in console)", barcodes); 
                    }) 
                    .fail(showServiceError); 
            }) 
            .fail(showServiceError); 
    } 
} 

Requirements

Target Platforms

Help Version 20.0.2019.4.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly