[Resolvido] WBarCode gera Cód. Barras corretamente ?
Olá, pessoal!
Utilizamos a procedure WBarCode para gerar as barras dos boletos que geramos, isso desde 2005.
No entanto, agora recebemos reclamações de que as máquinas dos bancos não conseguem ler os boletos. Fiz uma comparação visual entre os boletos que geramos na Web e os gerados pelo sistema Desktop, e confirmei a diferença das barras.
Cabe ressaltar que na Web só imprimos as 2º vias, sendo assim, o código de barras (os números) é igual no sistema interno e na Web.
Alguém tem ideia do motivo desse problema?
Baixei a WBarCode do fórum SuperASP, e lembro que funcionava direitinho.
Utilizo ASP clássico.
Qualquer ajuda será bem vinda!!
Rebeca
Em tempo!
Eis a procedure que utilizo, baixada do SuperASP:
<%
'**************************
Sub WBarCode( Valor )
'**************************
'William Nazato
'wil@merconet.com.br
Dim f, f1, f2, i
Dim texto
Const fino = 1
Const largo = 3
Const altura = 50
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
end if
'Desenho da barra
' Guarda inicial
%>
<img src=2.gif width=<%=fino%> height=<%=altura%> border=0><img
src=1.gif width=<%=fino%> height=<%=altura%> border=0><img
src=2.gif width=<%=fino%> height=<%=altura%> border=0><img
src=1.gif width=<%=fino%> height=<%=altura%> border=0><img
<%
texto = valor
if len( texto ) mod 2 <> 0 then
texto = "0" & texto
end if
' Draw dos dados
texto=trim(texto & "")
do while len(texto) > 0
i = cint( left(texto, 2) )
texto = right( texto, len( texto ) - 2)
f = BarCodes(i)
for i = 1 to 10 step 2
if mid(f, i, 1) = "0" then
f1 = fino
else
f1 = largo
end if
%>
src=2.gif width=<%=f1%> height=<%=altura%> border=0><img
<%
if mid(f, i + 1, 1) = "0" Then
f2 = fino
else
f2 = largo
end if
%>
src=1.gif width=<%=f2%> height=<%=altura%> border=0><img
<%
next
loop
' Draw guarda final
%>
src=2.gif width=<%=largo%> height=<%=altura%> border=0><img
src=1.gif width=<%=fino%> height=<%=altura%> border=0><img
src=2.gif width=<%=1%> height=<%=altura%> border=0>
<%
'**************************
end sub
'**************************
%>
Discussão (3)
Carregando comentários...