Answer the question
In order to leave comments, you need to log in
How to extract data from PDF417 ticket code of Russian Railways?
Russian Railways tickets have a code in PDF417 format .
When I read it, I get a string in binary format. It looks like it's compressed.
The beginning of the string is always bytes: 01 00 01 00 ending 1B 10 0A.
The question is how to determine the compression algorithm and extract useful information from the ticket code?
I want to know the number, date and time of departure of the train, arrival time, car and place.
In the test ticket, I received the following content:
Answer the question
In order to leave comments, you need to log in
It turned out to be unexpectedly difficult to pull out the "data" ....))) I tried it on single tickets of the CPPK.
The data is encoded in PDF417 format.
The ticket structure consists (as a rule, there are exceptions) of 88 bytes. For example:
"16 30 0f 00 00 00 00 00 00 00 00 00 b8 b0 ef 5b 0c 1c 25 00 eb c0 00 c0 08 91 b9 d9 b7 c2 87 06 5b 0c aa f6 f7 14 bf 0e 06 20 2d 51 25 bc ed 76 32 4d 6e 9e bc bf f2 b0 65 ff 91 47 94 ea 82 4d c6 f6 92 66 96 6e d0 c4 94 53 ef 2a c4 52 15 2b 8c 88 48 9d 87 d9 9f "
Here:
0th byte: (16) - "layout" - code of location (distribution) of data;
1st and 2nd bytes - "document number" (travel ticket): (0f30)hex--->(3888)decimal...
etc.
are also encoded:
- type of ticket ("one way", "round trip");
- the availability of travel concessions and its type (preferential, non-monetary);
- date and time of ticket sale;
- route (from station... to station...);
- identifier of the ticket printing device;
and other data, some of which I still haven't figured out myself.... :(
The biggest inconvenience is getting the code.... because the online services listed don't work correctly....
To date, the bcTester 5.0.0.231 program works almost without errors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question