Package br.com.caelum.stella.boleto.exception

Examples of br.com.caelum.stella.boleto.exception.GeracaoBoletoException


        JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(Arrays.asList(boletos));
        relatorio = JasperFillManager.fillReport(templateJasper,parametros,  dataSource);
      }
      return relatorio;
    }catch(Exception e){
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here


  public void geraPDF(File arquivo) {
    try {
      OutputStream out = new FileOutputStream(arquivo);
      geraPDF(out);
    } catch (FileNotFoundException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

  public void geraPDF(OutputStream out){
    try {
      JasperPrint relatorio = geraRelatorio();
      JasperExportManager.exportReportToPdfStream(relatorio, out);
    } catch (Exception e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

   */
  public void geraPNG(File arquivo) {
    try {
      geraPNG(new FileOutputStream(arquivo));
    } catch (FileNotFoundException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

    try {
      JasperPrint relatorio = geraRelatorio();
      BufferedImage image = (BufferedImage) JasperPrintManager.printPageToImage(relatorio, 0, 2);
      ImageIO.write(image,"png",out);
    } catch (Exception e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

        "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
    try {
      velocityEngine.init(config);
      template = velocityEngine.getTemplate("/br/com/caelum/stella/boleto/template_html.vm");
    } catch (Exception e) {
      throw new GeracaoBoletoException("Não foi possivel iniciar a configuração do Velocity", e);
    }
  }
View Full Code Here

        outputChannel.write(buffer);
        buffer.clear();
      }

    } catch (Exception e) {
      throw new GeracaoBoletoException("Erro ao escrever arquivo do boleto", e);
    } finally {
      fecharSilenciosamente(outputChannel);
      fecharSilenciosamente(inputChannel);
    }
  }
View Full Code Here

      is.read(b);

      return b;

    } catch (Exception e) {
      throw new GeracaoBoletoException("Erro na geração do boleto", e);
    } finally {
      fecharSilenciosamente(is);
    }
  }
View Full Code Here

    if (stream == null) {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      try {
        ImageIO.write(PNGimage, "PNG", baos);
      } catch (IOException e) {
        throw new GeracaoBoletoException(e); // nao esperado
      }
      stream = new ByteArrayInputStream(baos.toByteArray());
    }
    return stream;
  }
View Full Code Here

  private void geraTemplateComOFundoDoBoleto(Boleto boleto) {
    try {
      this.writer.writeImage(0, 55, imageFor(imagemTitulo), 514.22f, 385.109f);
      this.writer.writeImage(0, 805 - 486, imageFor(boleto.getBanco().getImage()), 100, 23);
    } catch (IOException e) {
      throw new GeracaoBoletoException("Erro na leitura das imagens do boleto", e);
    }
   
    for (int i = 0; i < boleto.getDescricoes().size(); i++) {
      this.writer.writeBold(5, 805 - 70 - i * 15, boleto.getDescricoes().get(i));
    }
View Full Code Here

TOP

Related Classes of br.com.caelum.stella.boleto.exception.GeracaoBoletoException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.