I'm using classic asp generating the barcode in PDF.
I found a problem, in the function below, calculate the barcode with one more digit,
If someone can help you find the error thank you.
I made several changes but could not get the result.
The value that should be displayed is: 481115243200001
however,
presents:% with a zero% more.
I'm using this routine for the default 2 of 5
Sub fbarcode(Valor)
Dim f, f1, f2, i
Dim texto
Dim p11
p11=11
Const fino = 0.4
Const largo = 0.7
Dim BarCodes(99)
if isempty(BarCodes(0)) then
BarCodes(0) = "00110"
BarCodes(1) = "10001"
BarCodes(2) = "01001"
BarCodes(3) = "11000"
BarCodes(4) = "00101"
BarCodes(5) = "10100"
BarCodes(6) = "01100"
BarCodes(7) = "00011"
BarCodes(8) = "10010"
BarCodes(9) = "01010"
for f1 = 9 to 0 step -1
for f2 = 9 to 0 Step -1
f = f1 * 10 + f2
texto = ""
for i = 1 To 5
texto = texto & mid(BarCodes(f1), i, 1) + mid(BarCodes(f2), i, 1)
next
BarCodes(f) = texto
next
next
pdf.Text "30","225",texto
end if
xPos=55
p201=230
pdf.rect xPos, p201, fino, p11, "F"
xPos = xPos + fino + fino
pdf.rect xPos, p201, fino, p11, "F"
xpos = xpos + fino + fino
For n = 1 To Len(valor_barras) Step 2
cASC = cint(Mid(valor_barras, n, 2))
For i = 1 To 10 Step 2
If Mid(BarCodes(cASC), i, 1) = "0" Then
F = fino
Else
F = largo
End If
pdf.rect xpos, p201, F, p11, "F"
xpos = xpos + F
If Mid(BarCodes(cASC), i + 1, 1) = "0" Then
xpos = xpos + fino
Else
xpos = xpos + largo
End If
Next
Next
pdf.Text "30","235",xpos
pdf.rect xpos, p201, largo, p11, "F"
xpos = xpos + fino + largo
pdf.rect xpos, p201, fino, p11, "F"
end Sub