1

I work with 2D barcodes a lot in my moonlighting gigs, and scan barcodes on my phone with my computer and vice versa several times a day. There are many QR code scanners and generators out there, but many only work with QR with standard encoding and no error correction. On Windows, I have a writer that can generate almost anything except Maxicode and provides a wealth of configuration options for its code standards, as well as a reader and writer for QR that only supports standard encoding. For Android, I have a reader/writer that reads every encoding for QR, Aztec, DataMatrix, PDF417, and a wealth of 1D codes including Code39, but cannot write GS1 QR or HIBC Datamatrix. I've also found some web pages that can scan these, but for security will not use them online and do not know how to get them to work offline.

So my reading and writing for both of these is piecemeal at best, and I'd like to create as consistent as possible a UX across devices while maintaining the ability to read and write in the following formats on both machines:

  • HIBC compliant Datamatrix

  • GS1 compliant QR with EC

  • Aztec

  • PDF417

  • Code39

    Optimally, it should include:

  • MaxiCode

  • EAN/ISBN/UPC

  • Codablock

  • Code One

If I have to use multiple applications, that is fine, as long as the above minimum functions are met.

1

I understand you are trying to create a single UX that would allow for several different barcode symbiologies. I would recommend taking a look at the LEADTOOLS SDK which is a paid for library which provides support for both reading and writing the 1D and 2D barcode symbologies you mentioned above. As a disclaimer I do work for this vender, however I would recommend taking a look at all the barcode symbologies that are supported and the different programming languages supported for the functionality in the link below. https://www.leadtools.com/sdk/barcode

Here is a small .NET C# code snippet for reading barcodes and generating an output of its symbology, location and value.

  BarcodeData[] dataArray = barcodeEngineInstance.Reader.ReadBarcodes(theImage, LeadRect.Empty, 0, null); 
             
  StringBuilder sb = new StringBuilder(); 
  sb.AppendFormat("{0} barcode(s) found", dataArray.Length); 
  sb.AppendLine(); 
             
  for(int i = 0; i < dataArray.Length; i++) 
  { 
     BarcodeData data = dataArray[i]; 
             
     sb.AppendFormat("Symbology: {0}, Location: {1}, Data: {2}", data.Symbology.ToString(), data.Bounds.ToString(), data.Value); 
     sb.AppendLine(); 
  } 

For writing a barcode here is a code snippet also in .NET C# in creating a UPC A barcode.

// Create a UPC A barcode 
   BarcodeData data = new BarcodeData(); 
   data.Symbology = BarcodeSymbology.UPCA; 
   data.Value = "01234567890"; 
   data.Bounds = new LeadRect(10, 10, 600, 200); 
                 
   // Setup the options to enable error checking and show the text on the bottom of the barcode 
   OneDBarcodeWriteOptions options = new OneDBarcodeWriteOptions(); 
   options.EnableErrorCheck = true; 
   options.TextPosition = BarcodeOutputTextPosition.Default; 

      // Write the barcode 
      barcodeEngineInstance.Writer.WriteBarcode(theImage, data, options); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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