Leadtools.Documents Namespace : DocumentBarcodes Object |
function Leadtools.Documents.DocumentBarcodes()
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.
function barcodesExample() { // Load a new document var url = "http://demo.leadtools.com/images/tiff/barcode.tif"; console.log("Loading document ..."); lt.Documents.DocumentFactory.loadFromUri(url, null) .done(function (document) { console.log("Done. Reading barcodes ..."); // Read all the barcodes in the first page var page = document.pages[0]; page.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) { alert("Error reading barcodes " + errorThrown); }); }) .fail(function (jqXHR, statusText, errorThrown) { alert("Error loading document " + errorThrown); }); }