2

私の質問は、pdf417 バーコード形式をスキャンすると、スキャン結果に基づいて UPC_E 形式が返されることがありますか?

ここに私のコードのスニペットがあります

 private BarcodeView barcodeView;

    private BarcodeCallback callback = new BarcodeCallback() {
            @Override
            public void barcodeResult(BarcodeResult result) {
                if (result.getText() != null) {          
    Toast.makeText(getActivity(), result.getText(), Toast.LENGTH_LONG).show();
                }
            }
            @Override
            public void possibleResultPoints(List<ResultPoint> resultPoints) {
            }
        };

ここはライブラリです

compile 'com.journeyapps:zxing-android-embedded:3.3.0'
4

2 に答える 2

1

これで問題は解決しました。昔:)

private BarcodeCallback callback = new BarcodeCallback() {
            @Override
            public void barcodeResult(BarcodeResult result) {
                if (result.getText() != null) {
                    String barcodeResult = result.getText();
                    String barcodeFormat = result.getBarcodeFormat().toString();
                    if (barcodeFormat.equals("PDF_417")) {
                        try {
                            String barcodeEncodedResult = new ConvertUtil().encodeIntoBase64(barcodeResult);
                            processEncodedResult(barcodeEncodedResult);
                        } catch (UnsupportedEncodingException e) {
                            e.printStackTrace();
                        }
                    } else {
                        Toast.makeText(getActivity(), "Unable to read as PDF_417 barcode format", Toast.LENGTH_LONG).show();
                    }
                }
            }
于 2018-08-16T07:56:30.567 に答える