您的位置:首页 > Web前端 > JQuery

生成条形码_jQuery_barcode

2015-07-02 11:14 906 查看
<html>

<head>

<scripttype="text/javascript"src="jquery-1.3.2.min.js"></script>

<scripttype="text/javascript"src="jquery-barcode-2.0.1.js"></script>

<scripttype="text/javascript">


$(function(){

$("#bcTarget").barcode("1234567890128","ean13",{barWidth:2,barHeight:30});

});


</script>

</head>

<body>

<divid="bcTarget"></div>


</body>

</html>

[/code]

http://wiki.ossez.com/index.php?title=条形码开发包&variant=zh-cn#.E6.9D.A1.E5.BD.A2.E7.A0.81
更多条码见条码开发工具包
生成
详细实例地址点击打开链接http://download.csdn.net/detail/liubo682115/8861149




<html>

<head>

<scripttype="text/javascript"src="jquery-1.3.2.min.js"></script>

<scripttype="text/javascript"src="jquery-barcode-2.0.1.js"></script>

<scripttype="text/javascript">


$(function(){

$("#bcTarget").barcode("123456789","codabar",{barWidth:2,barHeight:30});


$("#genid").click(function(){

		varcode=$("#orgcode").val();

		$("#mycode").barcode(code,"codabar",{barWidth:2,barHeight:30});

});

});


</script>

</head>

<body>

首先自动生成条形码123456789

<divid="bcTarget"></div>

输入要生成条形码的数字

<inputtype="text"id="orgcode">

<divid="mycode"></div>

<inputtype="button"value="生成条形码"id="genid"/>

</body>

</html>

[/code]







生成类型有多种
具体官方文档


Prototypeofthebarcodefunction

barcode:function(datas,type,settings)


datas

string

Valuebarcode(dependentonthetypeofbarcode)

Ifbarcodetypeincludeit,thepresenceofthechecksumisnotmandatory,itiseautomaticallyrecalculated

object

type:ean8,ean13,code11,code39,code128,codabar
memberType
codestring
type:std25,int25,code93
memberType
codestring
crcboolean
type:msi
memberType
codestring
crcboolean
objectcrc1:string("mod10","mod11")
crc2:string("mod10","mod11")
type:datamatrix
memberType
codestring
rectboolean(default:false)


type(string)

codabar
code11(code11)
code39(code39)
code93(code93)
code128(code128)
ean8(ean8)
ean13(ean13)
std25(standard2of5-industrial2of5)
int25(interleaved2of5)
msi
datamatrix(ASCII+extended)


settings(object)

visualconfigurationofthebarcode
ParameterTypeDefaultvalueDetailLimitation
barWidthint1widthofabar1D
barHeightint50containerheight1D
moduleSizeint5largeur/hauteurd'unmodule2D
showHRIbooltruedisplaytext(HRI:HumanreadableInterpretation)
bgColortext#FFFFFFbackgroundcolor
colortext#000000barcodecolor
fontSizeint10fontsizeoftheHRI
outputtextcssoutputtype:css,svg,bmp,canvas
renderer:canvas
ParameterTypeDefaultvalueDetail
posXint0Xorigine
posYint0Yorigine
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: