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

Not detecting encrypted PDF 417 barcodes #30

Open
johnagar opened this issue Apr 28, 2020 · 1 comment
Open

Not detecting encrypted PDF 417 barcodes #30

johnagar opened this issue Apr 28, 2020 · 1 comment

Comments

@johnagar
Copy link

I am testing the plugin to read the South African drivers license which is in PDF 417 format but the data is encrypted. I have done tests on other PDF 417 codes that contain plain text and these work fine. The plugin may have some built code that is trying to interrupt the scanned data, which will clearly fail with encrypted data. Is that a way to get the raw data returned and my Javascript code takes it from there?

John Agar

@thirion
Copy link

thirion commented Jul 21, 2020

Hi John. What I did was add an extra parameter for isBinary when scanning.
When returning the result and isBinary is true I convert it to HEX and return that in the callback instead.

Since the SA Drivers License is encrypted and encoded (and apparently nobody has the spec for it) you have to send it to a third party for decryption.

I had some trouble with this recently when trying to build a project with more recent versions of Corova, Node, Npm, Android platform etc..
I ended up using this plugin and just added my isBinary functionality: https://github.com/Ratsoc/cordova-plugin-google-mobile-vision-barcode-scanner.
Now that plugin is giving me issues building on iOS, but that's another story.

==
Ok, so I've gotten the other plugin to build on iOS as well, but your issue got me thinking: The other plugin returns the raw data by default instead of the text representation like this one, so if you can convert the binary to hex in javascript you don't need to modify the plugin at all.
I tested it today and it's working well. Let me know if you need more info

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

2 participants