I need some simple kit (could be SDK or the best would be simple console app) to read barcode from image file for linux, and mandatory is PDF417 2D code support, any ideas?


1 Answer 1


If you are looking for a commercial SDK to read your PDF417 barcodes on Linux, you may want to consider trying the LEADTOOLS Barcode SDK for Linux. The SDK ships with command line barcode demos in both C and Java which contain the source code that you can reference for how all this is done.

The LEADTOOLS SDK can take in any of the 150+ supported image formats and read the barcodes from them in just a few lines of code. Below is a simple example function in Java of how this would be done:

private void readBarcode(DemoData demoData, BarcodeEngine barcodeEngine){
   RasterImage rasterImage = null;
   RasterCodecs rasterCodecs = null;
   try {
      // Create RasterCodecs
      rasterCodecs = new RasterCodecs();

// Create a LEAD stream from the input file ILeadStream stream = LeadStreamFactory.create(demoData.filePath); // Load the raster image rasterImage = rasterCodecs.load(stream); // Set barcode symbology to PDF417 BarcodeSymbology[] symbologies = {BarcodeSymbology.PDF417}; // Read Barcode System.out.println("Read Barcode..."); BarcodeData[] barcodes = barcodeEngine.getReader().readBarcodes(rasterImage, LeadRect.getEmpty(), 0, symbologies); // Print out the Barcodes we found System.out.println("The image contains " + barcodes.length +" barcodes"); for(int i = 0; i < barcodes.length; i++) { BarcodeData barcode = barcodes[i]; System.out.println((i + 1) + ". " + barcode.getSymbology() + " --> " + barcode.getValue()); } } catch(Exception exception) { System.out.println(exception.getMessage()); } finally { // Dispose the raster codecs if (rasterCodecs != null) rasterCodecs.dispose(); // Dispose the raster image if (rasterImage != null) rasterImage.dispose(); } }

Just as a disclaimer. I work for the company that wrote this library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.