Manages the global barcodes settings for the document.
function lt.Documents.DocumentBarcodes
class lt.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.
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.
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);
});
}