The code copy is as follows:
<title>Barcode generation</title>
<%
Rem ======================================================================================
Rem = function:ean13
Rem = Description: Generate EAN13 standard barcode with example (ASP code)
Rem = Version: 1.0.0
Rem = Author: The seventh right angle (7th/semico)
Rem = Date:2005-08-08 11:57:06
Rem = QQ:11110785
Rem = QQ group: 3773360
Rem = Applicable: Generate EAN13 standard barcode as needed
Rem ======================================================================================
Function ean13(code,w,h)
Dim Guide, Dict, Lencode, Rencode, cStart, cMid, cEnd, Barcode, Lmethod
Guide = array("AAAAAAA","AABABB","AABBAB","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABAB","ABABBA","ABBABA")
Set Dict = CreateObject("Scripting.Dictionary")
Dict.Add "A", "0001101001100100100111101010100011011011000101011101101101101101101101101100010111"
Dict.Add "B", "01001110110011011010100001001001110110110010001010010010010010010010010010111"
Rencode = array("1110010","1100110","1101100","1000010","1011100","10011100","1010000","10001000","11101000")
cStart="101"
cMid="01010"
cEnd="101"
if w<2 then w=2
if h<20 then h=20
cWidth=w'Barcode Unit Width
cHeight=h'barcode height
'Check whether the barcode meets the standards
if len(code)<>13 then response.write "must be 13 bits!":response.end
for i=1 to 12
if IsNumeric(mid(code,i,1)) then
if i mod 2 then
rsum=rsum+int(mid(code,i,1))
else
lsum=lsum+int(mid(code,i,1))
end if
else
response.write "must be a digital code!":response.end
end if
next
if 10-((lsum*3+rsum) mod 10) <> int(right(code,1)) then response.write "This barcode is wrong!":response.end
'Convert barcode
Barcode=cStart
Lmethod=left(code,1)
'if Lmethod=0 then Lmethod=1
for i=2 to 7
barcode = barcode & mid(Dict(Mid(Guide(Lmethod-1),i-1,1)),(7*mid(code,i,1)+1),7)
next
barcode=barcode & cMid
for i=8 to 13
barcode = barcode & Rencode(mid(code,i,1))
next
barcode=barcode & cEnd
fg="#000000"'Barcode foreground color
bg="#ffffff"'Barcode background color
response.write "<div style='position:absolute;width:"&cWidth*95+60&"px; height:"&cHeight+30&"px; background:"&bg&";'>"
'Draw barcode
for x=1 to len(barcode)
if x<5 or x>92 or (x>46 and x<51)then
sh=10
else
sh=0
end if
if mid(barcode,x,1)="1" then
bColor=fg
else
bColor=bg
end if
response.write "<div style='position:absolute;left:"&(x-1)*cWidth+30&"px;top:5px;width:"&cWidth&"px;height:"&cHeight+5+sh&"px;background:"&bColor&";'></div>"