To tentando fazer uns testes com jboleto mas não ta dando certo.
ele não da erro algum, mas não gera o boleto.
alguem pode me dar uma luz.
essa é a classe q gera o boleto:
package boleto;
import java.util.Vector;
import org.jboleto.JBoleto;
import org.jboleto.JBoletoBean;
import org.jboleto.control.Generator;
import org.jboleto.control.PDFGenerator;
public class GeraBoleto {
public void geraBoletoItau()throws Exception{
JBoletoBean jBoletoBean = new JBoletoBean();
jBoletoBean.setDataDocumento("05/09/2009");
jBoletoBean.setDataProcessamento("05/09/2009");
jBoletoBean.setCedente("Empresa Teste");
jBoletoBean.setNomeSacado("Cliente Teste");
jBoletoBean.setEnderecoSacado("Rua Teste 00100");
jBoletoBean.setBairroSacado("Centro");
jBoletoBean.setCidadeSacado("Rio de Janeiro");
jBoletoBean.setUfSacado("RJ");
jBoletoBean.setCepSacado("55750-080");
jBoletoBean.setCpfSacado("[telefone removido]");
jBoletoBean.setDataVencimento("10/10/2009");
jBoletoBean.setInstrucao1("APOS O VENCIMENTO COBRAR MULTA DE 2%");
jBoletoBean.setInstrucao2("APOS O VENCIMENTO COBRAR R$ 0,30 POR DIA DE ATRASO");
jBoletoBean.setInstrucao3("");
jBoletoBean.setInstrucao4("");
jBoletoBean.setCarteira("175");
jBoletoBean.setAgencia("5584");
jBoletoBean.setContaCorrente("08850");
jBoletoBean.setDvContaCorrente("5");
jBoletoBean.setNossoNumero("34556",8);
jBoletoBean.setNoDocumento("34556");
jBoletoBean.setValorBoleto("844.00");
Generator generator = new PDFGenerator(jBoletoBean, JBoleto.ITAU);
JBoleto jBoleto = new JBoleto(generator, jBoletoBean, JBoleto.ITAU);
jBoleto.addBoleto();
jBoleto.closeBoleto("teste.pdf");
}
}
aqui chamo o método em uma jsp:
<%@page import="boleto.GeraBoleto"%>
<%
try{
GeraBoleto gb = new GeraBoleto();
gb.geraBoletoItau();
out.print("Boleto gerado com sucesso.");
}catch(Exception e){
out.print(e.getMessage());
}
%>
