Class BarcodeManager


  • public class BarcodeManager
    extends Object
    Utility methods for barcodes
    Since:
    8.1
    Author:
    Marco Meschieri - LogicalDOC
    • Constructor Detail

      • BarcodeManager

        public BarcodeManager()
    • Method Detail

      • extract

        public List<Barcode> extract​(com.logicaldoc.core.document.Document doc,
                                     Collection<String> possibleFormats)
                              throws IOException
        Extracts the barcodes from the given document
        Parameters:
        doc - the document to process
        possibleFormats - list of admitted barcode formats
        Returns:
        the list of extracted barcodes
        Throws:
        IOException - a generic error during the processing
      • processDocument

        public void processDocument​(com.logicaldoc.core.document.Document doc,
                                    com.logicaldoc.core.document.DocumentHistory transaction,
                                    org.slf4j.Logger log)
                             throws Exception
        Throws:
        Exception
      • extractBarcodes

        public List<Barcode> extractBarcodes​(BufferedImage image,
                                             String tenant,
                                             Collection<String> possibleFormats)
        Recognizes all the barcodes inside the given image. The order is up-down, left-right
        Parameters:
        image - the image to process
        tenant - name of the tenant
        possibleFormats - list of possible barcode formats
        Returns:
        the list of extracted barcodes
      • extractBarcodes

        public List<Barcode> extractBarcodes​(File imageFile,
                                             String tenant,
                                             Collection<String> possibleFormats)
        Recognizes all the barcodes in the given image file.
        Parameters:
        imageFile - The image file to read
        tenant - name of the tenant
        possibleFormats - Collection of admitted barcode formats
        Returns:
        Ordered list of barcodes (up to bottom and left to right)
      • extractPDFBarcodes

        public List<Barcode> extractPDFBarcodes​(File pdffile,
                                                String tenant,
                                                Collection<String> possibleFormats)
        Recognizes all the barcodes in the given PDF file
        Parameters:
        pdffile - the pdf file to read
        tenant - name of the tenant
        possibleFormats - collection of admitted barcode formats
        Returns:
        ordered list of barcodes (up to bottom and left to right)
      • setConfig

        public void setConfig​(com.logicaldoc.util.config.ContextProperties config)
      • setStorer

        public void setStorer​(com.logicaldoc.core.store.Storer storer)
      • setTenantDao

        public void setTenantDao​(com.logicaldoc.core.security.dao.TenantDAO tenantDao)
      • setConverterManager

        public void setConverterManager​(com.logicaldoc.core.conversion.FormatConverterManager converterManager)
      • setBarcodeTemplateDao

        public void setBarcodeTemplateDao​(BarcodeTemplateDAO barcodeTemplateDao)
      • setDocumentManager

        public void setDocumentManager​(com.logicaldoc.core.document.DocumentManager documentManager)