Examples of GeracaoBoletoException


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

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

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

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

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

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

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

    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

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

  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

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

      byte[] b = geraPDF();

      fos.write(b);
      fos.close();
    } catch (Exception e) {
      throw new GeracaoBoletoException("Erro na geração do boleto em PDF", e);
    } finally {
      tentaFecharOFileOutput(fos);
    }
  }
View Full Code Here

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

  private void tentaFecharOFileOutput(Closeable c) {
    try {
      c.close();
    } catch (IOException e) {
      throw new GeracaoBoletoException("Erro ao fechar stream", e);
    }
  }
View Full Code Here

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

      byte[] b = geraPNG();

      fos.write(b);
    } catch (FileNotFoundException e) {
      throw new GeracaoBoletoException("Erro na geração do boleto em PNG", e);
    } catch (IOException e) {
      throw new GeracaoBoletoException("Erro na geração do boleto em PNG", e);
    } finally {
      tentaFecharOFileOutput(fos);
    }

  }
View Full Code Here

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

    try {
      b = new byte[is.available()];
      is.read(b);

    } catch (NumberFormatException e) {
      throw new GeracaoBoletoException("Erro na geração do boleto em HTML", e);
    } catch (IOException e) {
      throw new GeracaoBoletoException("Erro na geração do boleto em HTML", e);
    } finally {
      tentaFecharOFileOutput(is);
    }
    return b;
  }
View Full Code Here

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

   */
  public void geraHTML(String arquivo) {
    try {
      JasperExportManager.exportReportToHtmlFile(geraRelatorio(), arquivo);
    } catch (JRException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.