Passbook Bar Coding

I need to integrate Passbook with a website that provides PDF417 barcodes with binary encoded data (as opposed to text), for example:

PDF17 barcode encoded in binary

Is there a way to encode this binary in pass.json so that Passbook displays it on the iPhone identically to the original image?

Again, I cannot switch to text barcodes because I have no data. To clarify the attached figure, the PDF417 barcode is contained, which when decoded contains non-printable characters, such as the NULL character, so I call it binary.

UPDATE

Thus, the image is decoded into an array of bytes:

01 00 01 00 02 00 E7 C4 B5 96 B8 42 94 B3 B4 75 1A D1 F2 38 92 EA B5 0E 17 5D 0B 2A AA 64 18 CC 28 62 86 E5 74 5D A3 89 09 12 6E D5 7A 1A C9 EE BF 23 9C E1 60 AD 9E DE 92 6D E5 79 99 C7 91 F1 6A D5 82 2E B6 E3 81 24 F8 0A F8 E6 44 5D 56 D2 00 00 00 00 00 00 40 0D 00 09 20 23 00 96 13 5C 10 EC 0C EA A3 E8 A3 20 30 4B 2A 20 7D 0F BB DF F7 5E FA 1E 76 F7 40 20 10 08 04 02 81 40 20 30 A3 D5 6C 1A 04 76 14 10 

This is how I try to convert it to utf-8 string:

 {"message": "\u0001\u0000\u0001\u0000\u0002\u0000\u00E7\u00C4\u00B5\u0096\u00B8\u0042\u0094\u00B3\u00B4\u0075\u001A\u00D1\u00F2\u0038\u0092\u00EA\u00B5\u000E\u0017\u005D\u000B\u002A\u00AA\u0064\u0018\u00CC\u0028\u0062\u0086\u00E5\u0074\u005D\u00A3\u0089\u0009\u0012\u006E\u00D5\u007A\u001A\u00C9\u00EE\u00BF\u0023\u009C\u00E1\u0060\u00AD\u009E\u00DE\u0092\u006D\u00E5\u0079\u0099\u00C7\u0091\u00F1\u006A\u00D5\u0082\u002E\u00B6\u00E3\u0081\u0024\u00F8\u000A\u00F8\u00E6\u0044\u005D\u0056\u00D2\u0000\u0000\u0000\u0000\u0000\u0000\u0040\u000D\u0000\u0009\u0020\u0023\u0000\u0096\u0013\u005C\u0010\u00EC\u000C\u00EA\u00A3\u00E8\u00A3\u0020\u0030\u004B\u002A\u0020\u007D\u000F\u00BB\u00DF\u00F7\u005E\u00FA\u001E\u0076\u00F7\u0040\u0020\u0010\u0008\u0004\u0002\u0081\u0040\u0020\u0030\u00A3\u00D5\u006C\u001A\u0004\u0076\u0014\u0010";} 

However, the Passbook does not display an equivalent barcode. In fact, it only displays the first few bytes.

+6
source share
1 answer

I don’t think you want to decode the binary image data, but instead want to read the data from the barcode as if it were scanned.

You can use a service like http://zxing.org/w/decode.jspx , which gives you a barcode value as if it were being scanned.

Send the value "Raw Text" to pass.json.

I have not used this service, but after a quick read, I assume that it is in the "message" below:

 "barcode" : { "message" : "ABCD 123 EFGH 456 IJKL 789 MNOP", "format" : "PKBarcodeFormatPDF417", "messageEncoding" : "iso-8859-1" } 

ref: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/PassKit_PG/Chapters/Creating.html#//apple_ref/doc/uid/TP40012195-CH4-SW1

0
source

Source: https://habr.com/ru/post/957992/


All Articles