saumitrabhave / qr-zbar-ane

ANE for QR Code Reader
MIT License
84 stars 23 forks source link

PDF417 barcode scan is not working #74

Open makanmel opened 7 years ago

makanmel commented 7 years ago

Hi Saumitra,

Thank you for the great library it works fast and has many features.

I need to scan US driver licenses that have PDF147 codes with text information about a driver but unfortunately it's not working while other types are scanned good (QR, CODABAR, CODE39). Tried a sample PDF147 from wikipedia with no luck.

Android 4.4 (Motorola XT1030).

Sample barcode: https://en.wikipedia.org/wiki/PDF417#/media/File:PDF417_Barcode.svg

Tried the https://play.google.com/store/apps/details?id=org.magiclen.barcodescanner but it is not supported by my device while other two random applications from the Play Market work good: https://play.google.com/store/apps/details?id=mobi.pdf417 https://play.google.com/store/apps/details?id=com.scandit.demoapp

Any help will be much appreciated.

My Code (AIR 24.0):

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
    creationComplete="onCreationComplete(event)" >
    <fx:Script><![CDATA[
        import com.sbhave.nativeExtensions.zbar.Config;
        import com.sbhave.nativeExtensions.zbar.Scanner;
        import com.sbhave.nativeExtensions.zbar.ScannerEvent;
        import com.sbhave.nativeExtensions.zbar.Symbology;

        import mx.events.FlexEvent;

        private var s:Scanner = new Scanner();

        private function onCreationComplete(event:FlexEvent):void
        {
            s.setConfig(Symbology.PDF417, Config.ENABLE, 1);
            s.addEventListener(ScannerEvent.SCAN, function (event:ScannerEvent):void
            {
                console.text = event.data;
            });
            s.startPreview("back", 0, 0, width, height / 2);
            s.attachScannerToPreview();
        }

        ]]></fx:Script>
    <s:TextArea id="console" width="100%" height="50%" fontSize="36" fontFamily="Lucida Console"/>
</s:Application>