phonegap/phonegap-plugin-barcodescanner

Encoding a barcode

Open

#96 创建于 2015年10月30日

在 GitHub 查看
 (2 评论) (2 反应) (0 负责人)Objective-C++ (1,402 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (1,268 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Hello, I'm using this plugin in react-native thanks to : https://github.com/axemclion/react-native-cordova-plugin.

I have been able to scan a barcode and get it's data but now I'm trying to generate a barcode and I have a problem.

When I'm calling my function :

cordova.cordova.plugins.barcodeScanner.encode(
      cordova.cordova.plugins.barcodeScanner.format.ean_13,
      barcodeValue,
      function() {console.log('success')},
      function() {console.log('failed')}
  )}

I have this message : "Could not encode a barcode from the data provided".

If I put :

cordova.cordova.plugins.barcodeScanner.encode(
      cordova.cordova.plugins.barcodeScanner.Encode.TEXT_TYPE,
      "test",
      function() {console.log('success')},
      function() {console.log('failed')}
  )}

This code generate a qr_code but that's not what I want, I want a barcode.

I remenber that in android I was using the multiformatwriter class to generate my bitmap.

So is it possible to generate a barcode image or not ?

贡献者指南