HTML5 Plus Scan Barcode code128 problem

Source: Internet
Author: User

The recent use of HTML5 to write a webapp with html5+ (plus) barcode control, encountered a problem.

By default

var scan=new plus.barcode.Barcode (' bcid ');//bcid is the ID of the DIV

So directly to sweep any bar code, at this time the recognition rate, two-dimensional code, EAN13 code, such as the recognition speed, code128 code recognition speed is not only slow, but is recognized as EAN8.

Thought is the control does not support, check the information to HTML5 China Federation official website, found that support code128, but also see the same issue of the post, but the reply to the post, there is said that mobile phone does not support, there are said to suggest the type of ....

Conjecture is caused by a problem in which the control's internal barcode type matches the precedence order.

Then manually specify the barcode type code128 to try, as follows:

var filter=[plus.barcode.code128,plus.barcode.ean13]
var scan=new plus.barcode.Barcode (' bcid ', filter);

scan.onmarked=onmarked;
Scan.start ({conserve:true,filename: "_doc/barcode/"});

Fortunately, the modified code is very fast to recognize.

HTML5 Plus Scan Barcode code128 problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.