Dynamsoft / barcode-reader-javascript

Dynamsoft Barcode Reader JavaScript SDK for package managers. PDF417, QR Code, DataMatrix, MaxiCode and more are supported.
https://www.dynamsoft.com/barcode-reader/sdk-javascript/
Other
169 stars 111 forks source link

Cannot scan the PDF417 code in the driver license. #69

Closed Shing-Ho closed 3 years ago

Shing-Ho commented 3 years ago

I am using the Dynamsoft barcode scanner in the Electron React.js project.

I've copied the react example in the examples folder and it's working with a bigger image but it's not scanning the PDF417 code in the driver license. Is there anyway to get it work?

Tom-Dynamsoft commented 3 years ago

When you say it works with a bigger image, do you mean that image has a bigger barcode that gets read? If the PDF417 code can not be read, we can do some configurations to get it working. For example, try setting the reading mode to 'coverage', etc.

more info>>

Shing-Ho commented 3 years ago

@Tom-Dynamsoft Thank you for reply. So I printed the big PDF417 image than the DL. So it was working but not working with DL. Seems like it's small. setting mode coverage means set to where?

Shing-Ho commented 3 years ago

Could you send me more detailed code?

Shing-Ho commented 3 years ago
async componentDidMount(){
        try{
            this.scanner = this.scanner || await Dynamsoft.BarcodeScanner.createInstance();

            if(this.bDestroyed){
                this.scanner.destroy();
                return;
            }
            await this.scanner.updateVideoSettings({ video: { width: 1280, height: 720, facingMode: "environment" } });
            await this.scanner.updateRuntimeSettings("coverage");
            let runtimeSettings = await this.scanner.getRuntimeSettings();
            runtimeSettings.barcodeFormatIds = Dynamsoft.EnumBarcodeFormat.BF_PDF417
            await this.scanner.updateRuntimeSettings(runtimeSettings);

            this.scanner.setUIElement(this.elRef.current);
            this.scanner.onFrameRead = results => {
                if(results.length){
                    // console.log(results);
                }
            };
            this.scanner.onUnduplicatedRead = (txt, result) => {
                console.log(result);
                this.props.appendMessage(result.BarcodeFormatString + '***' +result.BarcodeText);
            };
            await this.scanner.open();

        }catch(ex){
            this.props.appendMessage(ex.message);
            console.error(ex);
        }
    }

This is my current code.

Tom-Dynamsoft commented 3 years ago

@Shing-Ho Your code seems to have used the 'coverage' setting already. If the barcode still isn't getting read, is it possible to share it with us (email support @ dynamsoft.com).

BTW, seems I never asked this, but could the barcode be read on our demo? https://demo.dynamsoft.com/dbr_wasm/barcode_reader_javascript.html

Shing-Ho commented 3 years ago

The barcode is working barcode, I could recognize it with the mobile phone. Also, I've receive reply from live support and they recommend camera zoom in how can we do that?

Shing-Ho commented 3 years ago

Can you scan your driver license with your electron or react example demo?

Tom-Dynamsoft commented 3 years ago

@Shing-Ho Our team is following up on the issue (ticket id 482910), I'll close the issue here