Examples of GeracaoBoletoException


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

                    .getWidth(), image.getHeight());
            template.addImage(pdfImage);
            final float leftMargin = this.document.leftMargin();
            this.contentByte.addTemplate(template, leftMargin + x, y);
        } catch (BadElementException e) {
            throw new GeracaoBoletoException(e);
        } catch (DocumentException e) {
            throw new GeracaoBoletoException(e);
        }
    }
View Full Code Here

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

    writer.writeImage(0, 55, imageFor(imagemTitulo), 514.22f,
      385.109f);
    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++) {
    writer.writeBold(5, 805 - 70 - i * 15, boleto.getDescricoes()
View Full Code Here

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

            byte[] b = toPDF();

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

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

    private void tryToClose(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.GeracaoBoletoException

            byte[] b = toPNG();

            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 {
            tryToClose(fos);
        }
View Full Code Here

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

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

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

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

            this.fonteSimples = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.EMBEDDED);
            this.fonteBold = BaseFont.createFont(BaseFont.HELVETICA_BOLD, BaseFont.WINANSI, BaseFont.EMBEDDED);

        } catch (DocumentException e) {
            throw new GeracaoBoletoException(e);
        } catch (IOException e) {
            throw new GeracaoBoletoException(e);
        }

        this.document.open();
        this.contentByte = this.writer.getDirectContent();
        this.document.newPage();
View Full Code Here

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

            PdfTemplate template = this.contentByte.createTemplate(image.getWidth(), image.getHeight());
            template.addImage(pdfImage);
            final float leftMargin = this.document.leftMargin();
            this.contentByte.addTemplate(template, leftMargin + x, y);
        } catch (BadElementException e) {
            throw new GeracaoBoletoException(e);
        } catch (DocumentException e) {
            throw new GeracaoBoletoException(e);
        }
    }
View Full Code Here

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

      templateJasper = GeradorDeBoleto.class.getResourceAsStream("/br/com/caelum/stella/boleto/templates/boleto-default.jasper");
      parametros.put(JRParameter.REPORT_LOCALE, new Locale("pt", "BR"));
      InputStream template_sub = GeradorDeBoleto.class.getResourceAsStream("/br/com/caelum/stella/boleto/templates/boleto-default_instrucoes.jasper");
      parametros.put("SUB_INSTRUCOES", JRLoader.loadObject(template_sub));
    } catch (JRException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

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

        JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(boletos);
        relatorio = JasperFillManager.fillReport(templateJasper,parametros,  dataSource);
      }
      return relatorio;
    }catch(Exception 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.