Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2124

barcore scanner using pdfbox and zxing

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.0.0
    • 4.0.0
    • Utilities
    • None
    • W8

    Description

      Dear Pdfbox,

      I have just finished a work to integrate pdfbox and zxing to extract barcodes, and I wanted to give this source code to your fundation.

      Program do this :

      • extract all scanned images in a PDF,
      • apply some homebrew image filters to retrieve areas of interest,
      • rotate cropped areas and send them to zxing to find any barcode
      • aggregate all results in specific List

      Hope it can be useful for Pdfbox or Lucence.

      Example :

      	public static void main(String[] args) throws Exception {
      		long startTime = System.currentTimeMillis();
      		System.out.println("PdfBoxBarcodeScannerTest starts...");
      		String filename = "D:\\test\\mail_with_barcode.pdf";
      		
      		
      		PdDocumentBarcodeScanner scanner = new PdDocumentBarcodeScanner(new File(filename));
      		scanner.scan();
      		long endTime = System.currentTimeMillis();
      
      		System.out.println("pdf scanned in " + (endTime - startTime) + " ms");
      		
      		scanner.displayResults();
      	}
      
      

      Gives :

      PdfBoxBarcodeScannerTest starts...
      pdf scanned in 3803 ms
      page=0, barcodeFormat=DATA_MATRIX, value=HP14601225523

      Best regards
      David KELLER

      Attachments

        1. mail_with_barcode.pdf
          438 kB
          David KELLER
        2. PdDocumentBarcodeScanner.java
          1 kB
          David KELLER
        3. PdPageBarcodeScanner.java
          14 kB
          David KELLER

        Activity

          People

            Unassigned Unassigned
            david.keller David KELLER
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: