Do you like codes? Well, or do not love. In any case, sometimes you need to know how to use them correctly. You can go the long way, as I did last time , but when there is no time, it is easier to use the instructions.
So, let's deal with everything you need to read and / or write PDF417. After all, it’s not always at hand to find a smartphone with a program for reading them. And for the record - and even more so.
Attention, under the cut - 9 images with a total size of 2.79 MB, 6 tables and a few formulas.
Table of contents
01. History of PDF417 and right of use
( Back | Table of Contents | Forward )
PDF417 invented by Symbol Technologies Inc. in 1991, and on September 7, 1993, a US patent was issued for him under the number 5,243,655 (available, for example, here ). In fact, the patent describes not just a coding method, but a complex system for encoding and decoding data ( "System for encoding and decoding data in machine readable graphic form" ). In addition, not all of the recommendations in the patent are currently used.
, PDF417 , .
: ISO/IEC 15438:2015, PDF417, — 198 CHF ( ). , . , , .
02.
( | | )
() PDF417 (. 1) — , . , ( ) . ().
, . PDF417 3 90 , 3 30 .

. 1. PDF417
17 ( ), 4 4 . 1 6 .
(). 3 (), "", "". , , . .
PDF417 . , , — , — . (. 2), .
:
,
,
— 9.
, 3 , 9 , . : .
PDF417 929 ( 000
928
).
03.
( | | )
(. 2):

. 2. PDF417
, , ( 900
, ), .
04.
( | | )
, PDF417 000
928
. , 2 787 .
000
899
.
900 : 928
— (. 1). 900
, 901
, 902
, 913
924
, .
. 1. PDF417. ,
PDF macro PDF417 . , ( ) .
ECI / GLI — Extended Channel Interpretation / Global Label Identifier — , . , ( , GLI 0, ), .
04.a) (TC, Text Compaction Mode)
( | | )
PDF417 ( ). 4 :
- Alpha ( );
- Lower case;
- Mixed;
- Punctuation.
. 2. GLI 0
al
, ll
, ml
pl
— alpha, lower case, mixed punctuation (l = latch
);as
ps
— alpha punctuation (s = shift
) .
900 2 :
,
— 900, — , — . .
, , -, - 29.
shift- . latch- .
04.b) - (BC, Byte Compaction Mode)
( | | )
900. 256. :
, 6 5 256 900. , 0x01
, 0x02
, 0x03
, 0x04
, 0x05
, 0x06
, (. 3).

. 3. , -
:
924
, 001
, 620
, 089
, 074
, 846
.
6, 6 5 , — . , 0x01
, 0x02
, 0x03
, 0x04
, 0x05
, 0x06
, 0x07
, 0x08
, 0x09
:
901
, 001
, 620
, 089
, 074
, 846
, 007
, 008
, 009
.
, - 913
.
04.c) (NC, Numeric Compaction Mode)
( | | )
10 900. , 0 9. , 44 15 .
902
. , 13 . , 3 ( , 2.93) , , (2 ).
900 1 , . 4. , 1 .

. 4. ,
05.
( | | )
. PDF417 2 . , , (. 3).
. 3. PDF417
:
- , (erasures), " ";
- , , (errors), " ".
:
;
;
;
.
:
2 , , , .
Error Correction Capacity, , . , , . , , , :
.
2 , . 2 .
, , 13 , 7 , , (9 2 ..).
- . .
(. 4).
. 4.
( | | )
( 03), PDF417.
, , . , , , , , (. 5).

. 5.
07.
( | | )
x-, 17- GitHub
( 02), PDF417 3 (0, 3 6) 929 . 17- , x-. , , , , . 5.
. 5. 20 x-
08. 8-
( | | )
GLI 0
ASCII 0:127. 128:255 PC 437.
. 6. GLI 0, PDF417
GLI 1
ISO 8859-1 ().
09. PDF417,
( | | )
PDF417 .
, , PDF417 - -, x- 81111113 711311121 (18 ) .
, PDF417 (. 6). , - -.

. 6. 0 PDF417
10.
( | | )
. ( 0, 0). , 19 (. 7). , , ( , , 06). , 1 -, 18 - 8 , 27, .
. , .

. 7. ,
11. PDF417
( | | )
, 000
928
(. 8). , , .

. 8.
— 900 : 928
. . 8, . , (TC, 04.a).
12.
( | | )
, , 2 :
30, — 30.
:
(27)(07) (19)(19) (15)(18) (28)(14) (19)(19) (28)(07) (27)(00) (01)(17) (29)(17) (02)(14) (12)(29) (19)(15) (14)(18) (19)(28) (19)(05) (00)(00) (09)(06) (02)(29)
( . 2):
(ll)https(ml)://(al)H(ll)abr(ps).com(ps)/post(ml)/500962(ps)
(ll)
, (ml)
, (al)
(ps)
04.a.
:
https://Habr.com/post/500962
, . 8 ( 05).
13.
( | | )
— . .
, . , 3 . , ( ).
, — , ( 02). PDF417 , ( ..), , , — . , .
. , , ( ). .
14.
( | | )
, , .
1. P -
2. , (900)
3. N - , , P
4. N ≥ 13
5. (902)
6.
7. P
8. 3
9. N < 13
10. T - ,
.
(901, 902, 913, 924)
13 .
11. T ≥ 5
12. (900)
13.
14. P
15. 3
16. T < 5
17. B - ,
P. 11
4.
18. B == 1 & -
19. 1 (913)
20.
21. P
22. 3
23.
24. (901 924
, 04.b)
25.
26. P
27. 3
15. ,
( | | )
, PDF417 , . , ( , . 4). , .
, PDF417 " ", 2 .
:
— ;
— ;
— ;
— ;
— ();
— ;
— ( ).
16. () PDF417
( | | )
PDF417 "" ( ), PDF417 (Truncated PDF417, . 9).
:
34 15 :
. 9. PDF417 ( , )
, :
17.
( | | )
PDF417
18.
( | | )
, PDF417. (, , ) , .
, step by step:
, , , ( PDF417).
, , - . , .
!
P.S. , , . "Ctrl / ⌘ + Enter", Ctrl / ⌘, . , . !