Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Support for GS1 Encoded QR Code Creation in iOS Swift #590

Open
govindaraokondala opened this issue Jul 17, 2024 · 0 comments
Open

Comments

@govindaraokondala
Copy link

govindaraokondala commented Jul 17, 2024

Hello Team,

I am writing to request support for creating GS1 encoded QR codes within an iOS application developed using Swift. Our application requires the generation of QR codes that comply with GS1 standards to ensure interoperability and accurate data representation in various supply chain and logistics processes.

What we have done:

We have prepared a label (String) with gs1 compliant using below instructions.

https://www.gs1us.org/upcs-barcodes-prefixes/gs1-128

Ex: 400PO12345678-10241PART123372510GR-BATCH1123070417250704

Note: There are hidden separators in above string. You can find in below attachments.
STringWithSeperetor1

But when I try to create QR code for above string using below code and scan, we are resulting that it is not GS1 encoded QRcode.

func generateDataMatrixQRCode(from string: String) -> UIImage? {
        do {
            let writer = ZXMultiFormatWriter()
            let hints = ZXEncodeHints() as ZXEncodeHints
            hints.dataMatrixShape = ZXDataMatrixSymbolShapeHintForceSquare
            let result = try writer.encode(string, format: kBarcodeFormatDataMatrix, width: 150, height: 150, hints: hints)
            if let imageRef = ZXImage.init(matrix: result) {
                if let image = imageRef.cgimage {
                    let testImg  =   UIImage.init(cgImage: image)
                    return testImg
                }
            }
        }
        catch {
            print(error)
        }
        return nil
    }

GS1ScannedNotOmplined1

To support more encoding mechanism, we are using ZXing third party library.

The following barcodes are currently supported for both encoding and decoding in Zxing library

  • UPC-A and UPC-E
  • EAN-8 and EAN-13
  • Code 39
  • Code 93
  • Code 128
  • ITF
  • Codabar
  • RSS-14 (all variants)
  • QR Code
  • Data Matrix
  • Maxicode
  • Aztec ('beta' quality)
  • PDF 417 ('beta' quality)

So unfortunately we could not find any encoding type, neither the Apple default API nor the ZXing library.

But when I use the same string to create GS1 encoding using https://barcode.tec-it.com/en/GS1DataMatrix, it is properly decoding as GS1 encoded string.
GS1Scanned1

Question:

Is there any way to create GS1 encoded QRcode in ios with zxing lib?

Request:

I would greatly appreciate any guidance, documentation, or library recommendations that could assist in implementing this functionality. Specifically, we are looking for:

Example code or library that supports GS1 encoded QR code creation in Swift.
Documentation or guidelines on implementing GS1 standards for QR codes.
Any additional tools or resources that could facilitate this process.

Thank you for your attention to this matter. We look forward to your assistance in integrating GS1 encoded QR code generation into our iOS application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant