Example usage for com.itextpdf.text Chunk NEWLINE

List of usage examples for com.itextpdf.text Chunk NEWLINE

Introduction

In this page you can find the example usage for com.itextpdf.text Chunk NEWLINE.

Prototype

Chunk NEWLINE

To view the source code for com.itextpdf.text Chunk NEWLINE.

Click Source Link

Document

This is a Chunk containing a newline.

Usage

From source file:com.solidmaps.webapp.report.MapCivilPdfGenerator.java

License:Open Source License

private void createInvoiceTable(Document doc) throws DocumentException {

    doc.add(Chunk.NEWLINE);

    // Ajusta o cabealho
    float[] columnHeader = { 1f };
    PdfPTable tableHeader = new PdfPTable(columnHeader);
    tableHeader.setWidthPercentage(100f);
    insertCell(tableHeader, "\n RELAO DE COMPRAS DURANTE  O TRIMESTRE \n", Element.ALIGN_CENTER, fontText);

    doc.add(tableHeader);//ww w .  j  a v  a2  s.  c  om

    doc.add(Chunk.NEWLINE);

    // specify column widths
    float[] columnWidths = { 2f, 2f, 2f, 2f, 2f, 2f, 2.5f, 2f };
    // create PDF table with the given widths
    PdfPTable table = new PdfPTable(columnWidths);
    // set table width a percentage of the page width
    table.setWidthPercentage(100f);

    // insert column headings
    insertCell(table, "Data:", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "Empresa Vendedora", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "Endereo", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "Cidade/UF", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "CEP", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "N. nota Fiscal", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "Produto", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "Quantidade", Element.ALIGN_CENTER, fontHeaderTable);

    table.setHeaderRows(1);

    for (InvoiceProductEntity invoiceProduct : this.listInvoices) {
        insertCell(table, DateUtils.format(invoiceProduct.getInvoice().getDateCreate()), Element.ALIGN_CENTER,
                fontHeaderTable);
        insertCell(table, invoiceProduct.getInvoice().getProvider().getCnpj(), Element.ALIGN_CENTER,
                fontHeaderTable);
        insertCell(table, invoiceProduct.getInvoice().getProvider().getStreet(), Element.ALIGN_CENTER,
                fontHeaderTable);
        insertCell(table, invoiceProduct.getInvoice().getProvider().getCity(), Element.ALIGN_CENTER,
                fontHeaderTable);
        insertCell(table, invoiceProduct.getInvoice().getProvider().getCep(), Element.ALIGN_CENTER,
                fontHeaderTable);
        insertCell(table, invoiceProduct.getInvoice().getNumInvoice(), Element.ALIGN_CENTER, fontHeaderTable);
        insertCell(table, invoiceProduct.getProduct().getProductOfficial().getName(), Element.ALIGN_CENTER,
                fontHeaderTable);
        insertCell(table, invoiceProduct.getQtdProduct() + invoiceProduct.getTypeQtdProduct(),
                Element.ALIGN_CENTER, fontHeaderTable);
    }

    doc.add(table);
}

From source file:com.solidmaps.webapp.report.MapExercitoPdfGenerator.java

License:Open Source License

private void createFooter(Document doc) throws DocumentException {

    Calendar cal = Calendar.getInstance();
    PdfPTable table = new PdfPTable(1);
    table.setWidthPercentage(100f);//from www .  j av a2  s .  co m

    table.setHeaderRows(0);

    table.getDefaultCell().setBorder(PdfPCell.NO_BORDER);

    StringBuilder sbData = new StringBuilder();
    sbData.append(company.getCity()).append(" / ").append(company.getState()).append(", ")
            .append(cal.get(Calendar.DAY_OF_MONTH)).append(" de ").append(DateUtils.getMonthName(cal))
            .append(" de ").append(cal.get(Calendar.YEAR)).append("\n\n");

    insertCell(table, sbData.toString(), Element.ALIGN_RIGHT, fontHeaderTableBig, false);

    insertCell(table, "_________________________________________________ \n Nome: "
            + company.getUserResponsable().getName() + " \n Cargo: " + company.getUserResponsable().getOffice(),
            Element.ALIGN_RIGHT, fontHeaderTable, false);

    doc.add(Chunk.NEWLINE);

    doc.add(table);
}

From source file:com.solidmaps.webapp.report.MapExercitoPdfGenerator.java

License:Open Source License

private void createParagraph(Document doc) throws DocumentException {

    StringBuilder sbParagraph = new StringBuilder().append("EXCELENT?SSIMO SENHOR \n").append("COMANDANTE DA ")
            .append(company.getRegion()).append(" REGIO MILITAR \n").append(company.getCity().toUpperCase())
            .append(", ").append(company.getState());

    Paragraph paragraph = new Paragraph(sbParagraph.toString());
    paragraph.setFont(fontParagraph);//from   w w  w  .j  av a  2 s  .  c  om

    Paragraph paragraphText = new Paragraph("A firma: " + company.getName() + ", estabelecida  "
            + company.getState() + ", na Cidade " + company.getCity()
            + ", portadora do Certificado de Registro N " + license.getNumRegister() + ", vlido at "
            + DateUtils.format(license.getDateExpiration())
            + ", apresenta  V.Exa. o MAPA TRIMESTRAL DE ESTOCAGEM " + "DE PRODUTOS CONTROLADOS referente ao "
            + TrimesterEnum.getById(mapProduct.getNumTrimester()).getId() + " trimestre " + "de "
            + mapProduct.getYear()
            + ", de acordo com o Regulamento aprovado pelo Decreto N 3.665 de 20 de novembro de 2000, "
            + "para Fiscalizao de Produtos Controlados (R-105). CNPJ " + company.getCnpjFormatted());
    paragraphText.setFont(fontText);

    doc.add(paragraph);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphText);
    doc.add(Chunk.NEWLINE);
}

From source file:com.solidmaps.webapp.report.MapExercitoPdfGenerator.java

License:Open Source License

private void createProductsTable(Document doc) throws DocumentException {

    Paragraph paragraph = new Paragraph("RESUMO GERAL");
    paragraph.setFont(fontText);/*from   w w  w .j a v  a 2s .c om*/

    DecimalFormat dc = new DecimalFormat("########0.00");

    // specify column widths
    float[] columnWidths = { 2f, 2f, 2f, 2f, 2f, 2f, 2.5f };
    // create PDF table with the given widths
    PdfPTable table = new PdfPTable(columnWidths);
    // set table width a percentage of the page width
    table.setWidthPercentage(100f);

    // insert column headings
    insertCell(table, "PRODUTO:", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "GUIA DE TR?FEGO N:", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "ENTRADA", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "ESTOQUE DO TRIMESTRE ANTERIOR", Element.ALIGN_CENTER, fontHeaderTableSmall);
    insertCell(table, "CONSUMO", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "ESTOQUE PARA O TRIMESTRE SEGUINTE", Element.ALIGN_CENTER, fontHeaderTableSmall);
    insertCell(table, "PROCEDNCIA (RAZO SOCIAL, ENDEREO,CIDADE, CEP, E  N.DO CERTIFICADO DE REGISTRO)",
            Element.ALIGN_CENTER, fontHeaderTableTiny);

    table.setHeaderRows(1);

    for (InvoiceInventoryMapEntity productMap : listProductMapVO) {

        String companyCell = "PROCEDNCIA (" + company.getName() + ", " + company.getStreet() + ", "
                + company.getCity() + ", " + company.getCep() + ", " + license.getNumRegister() + ")";

        // Calcula o estoque para o Trimestre seguinte
        BigDecimal qtdNextPeriod = productMap.getQtdInventoryPreviusTrimester()
                .add(productMap.getQtdBuyProduct()).subtract(productMap.getQtdSellProduct())
                .subtract(productMap.getQtdUtilization());

        // Cria a tabela com os Produtos
        insertCell(table, productMap.getProduct().getName(), Element.ALIGN_CENTER, fontHeaderTableSmall);
        insertCell(table, productMap.getTrafficGuide(), Element.ALIGN_CENTER, fontHeaderTableSmall);
        insertCell(table, dc.format(productMap.getQtdBuyProduct()), Element.ALIGN_CENTER, fontHeaderTableSmall);
        insertCell(table, dc.format(productMap.getQtdInventoryPreviusTrimester()), Element.ALIGN_CENTER,
                fontHeaderTableSmall);
        insertCell(table, dc.format(productMap.getQtdUtilization()), Element.ALIGN_CENTER,
                fontHeaderTableSmall);
        insertCell(table, dc.format(qtdNextPeriod), Element.ALIGN_CENTER, fontHeaderTableSmall);
        insertCell(table, companyCell, Element.ALIGN_CENTER, fontHeaderTableSmall);
    }

    doc.add(paragraph);
    doc.add(table);

    doc.add(Chunk.NEWLINE);
}

From source file:com.solidmaps.webapp.report.RenovationRequireExercitoPDF.java

private void createParagraph(Document doc, LicenseEXEntity license) throws DocumentException {

    StringBuilder sbHeader = new StringBuilder().append("Exmo Sr Comandante da ")
            .append(license.getCompany().getRegion()).append(" Regio Militar");

    StringBuilder sbParagraph = new StringBuilder().append(license.getCompany().getName())
            .append(", estabelecida em ").append(license.getCompany().getCity()).append("/")
            .append(license.getCompany().getState()).append(",  ").append(license.getCompany().getStreet())
            .append(", telefone n ").append(license.getCompany().getUserResponsable().getPhoneDDD())
            .append(" ").append(license.getCompany().getUserResponsable().getPhoneNumber())
            .append(", representada, neste ato, por seu proprietrio (scio ou diretor, etc.), ")
            .append(license.getCompany().getUserResponsable().getName()).append(", ")
            .append(license.getCompany().getUserResponsable().getCountry()).append(", ")
            .append(license.getCompany().getUserResponsable().getMaritalStatus()).append(", ")
            .append(license.getCompany().getUserResponsable().getOffice()).append(", ")
            .append(" (domiciliado ) ").append(license.getCompany().getUserResponsable().getStreet())
            .append(", vem, pelo presente, requerer  V Exa. (concesso ou revalidao) do Certificado de Registro n ")
            .append(license.getNumRegister())
            .append(", de acordo com o art. 84 do Regulamento para a Fiscalizao de ")
            .append("Produtos Controlados (R-105), para importar, comerciar (ou manipular, utilizar industrialmente, ou o que for) ")
            .append("com armas, munies, plvora para caa (ou explosivos, produtos qumicos controlados), durante o trinio ")
            .append(DateUtils.format(license.getDateExpiration())).append(" - ")
            .append(DateUtils.format(DateUtils.addYear(license.getDateExpiration(), 3)));

    // Anexo/*from www .j a  va  2s  .  c om*/
    Paragraph paragraphHeaderAnexo = new Paragraph("ANEXO XVI");
    paragraphHeaderAnexo.setFont(FONT_HEADER);
    paragraphHeaderAnexo.setAlignment(Element.ALIGN_CENTER);

    // Texto cabealho
    Paragraph paragraphHeaderText = new Paragraph(
            "REQUERIMENTO PARA CONCESSO E REVALIDAO DE CERTIFICADO DE REGISTRO");
    paragraphHeaderText.setFont(FONT_HEADER);
    paragraphHeaderText.setAlignment(Element.ALIGN_CENTER);

    // Texto Comandante
    Paragraph paragraphComand = new Paragraph(sbHeader.toString());
    paragraphComand.setFont(FONT_PARAGRAPH);

    // Texto impresso
    Paragraph paragraphPrint = new Paragraph("(Impresso em papel liso com 16 espaos simples)");
    paragraphPrint.setFont(FONT_PARAGRAPH);

    // Texto da Empresa
    Paragraph paragraphCompany = new Paragraph(sbParagraph.toString());
    paragraphCompany.setFont(FONT_PARAGRAPH);

    // Texto Footer
    Paragraph paragraphFooter = new Paragraph("Nestes termos, pede deferimento");
    paragraphCompany.setFont(FONT_PARAGRAPH);

    // Texto data
    Paragraph paragraphDate = new Paragraph(DateUtils.format(Calendar.getInstance()));
    paragraphDate.setFont(FONT_PARAGRAPH);

    doc.add(paragraphHeaderAnexo);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphHeaderText);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphComand);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphPrint);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphCompany);
    doc.add(Chunk.NEWLINE);
    doc.add(Chunk.NEWLINE);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphFooter);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphDate);
    doc.add(Chunk.NEWLINE);

}

From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseExercitoPDF.java

private void createParagraph(Document doc, LicenseEXEntity license) throws DocumentException {

    StringBuilder sbHeader = new StringBuilder().append("Exmo Sr Comandante da ")
            .append(license.getCompany().getRegion()).append(" Regio Militar");

    StringBuilder sbParagraph = new StringBuilder().append(license.getCompany().getName().toUpperCase())
            .append(", incrita sob o CNPJ n ").append(license.getCompany().getCnpj())
            .append(", estabelecida na cidade de ").append(license.getCompany().getCity().toUpperCase())
            .append("/").append(license.getCompany().getState()).append(",  ")
            .append(license.getCompany().getStreet()).append(", CEP ").append(license.getCompany().getCep())
            .append(", email: ").append(license.getUserResponsable().getEmail()).append(", fone/fax ")
            .append(license.getUserResponsable().getPhoneDDD()).append(" ")
            .append(license.getUserResponsable().getPhoneNumber()).append(" representada neste ato por seu ")
            .append(license.getCompany().getUserResponsable().getOffice()).append(", Sr ")
            .append(license.getCompany().getUserResponsable().getName()).append(", inscrito sob o CPF: ")
            .append(license.getCompany().getUserResponsable().getCpf())
            .append(", portador da cdula de identidade (RG): ")
            .append(license.getCompany().getUserResponsable().getRg()).append(", de nacionalidade ")
            .append(license.getCompany().getUserResponsable().getCountry()).append(", estado civil ")
            .append(license.getCompany().getUserResponsable().getMaritalStatus())
            .append(" profisso Engenheiro Qumico, domiciliado a ")
            .append(license.getCompany().getUserResponsable().getStreet())
            .append(license.getCompany().getUserResponsable().getStreet()).append(" CEP ")
            .append(license.getCompany().getUserResponsable().getCep());

    if (license.getCompany().getProcuratorEntity() != null) {
        sbParagraph.append(" e seus procuradores, conforme procurao anexo, Sr ")
                .append(license.getCompany().getProcuratorEntity().getName()).append(" inscrito sob o CPF n: ")
                .append(license.getCompany().getProcuratorEntity().getCpf())
                .append(" portador da cdula de identidade (RG) n: ")
                .append(license.getCompany().getProcuratorEntity().getRg()).append(" ")
                .append(license.getCompany().getProcuratorEntity().getRgExpeditionCity());

    }/*  ww  w.  j  a v a 2 s  . c om*/

    sbParagraph.append(", vem pelo presente, requerer  V Ex.a ");

    // Texto cabealho
    Paragraph paragraphHeaderText = new Paragraph(
            "REQUERIMENTO PARA APOSTILAMENTO DE CERTIFICADO DE REGISTRO - PJ");
    paragraphHeaderText.setFont(FONT_HEADER);
    paragraphHeaderText.setAlignment(Element.ALIGN_CENTER);

    // Texto Comandante
    Paragraph paragraphComand = new Paragraph(sbHeader.toString());
    paragraphComand.setFont(FONT_PARAGRAPH);

    // Texto da Empresa
    Paragraph paragraphCompany = new Paragraph(sbParagraph.toString());
    paragraphCompany.setFont(FONT_PARAGRAPH);

    doc.add(paragraphHeaderText);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphComand);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphCompany);
    doc.add(Chunk.NEWLINE);

}

From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseExercitoPDF.java

/**
 * Incluso de Atividades/*from ww w  .j a  v a2 s  .c  o  m*/
 * 
 * @param doc
 * @param license
 * @param listCharterType
 * @throws DocumentException
 */
private void createCharter(Document doc, LicenseEXEntity license, List<CharterTypeEntity> listCharterType)
        throws DocumentException {

    if (listCharterType == null || listCharterType.isEmpty()) {
        return;
    }

    StringBuilder sb = new StringBuilder().append(numLine++).append("-) ")
            .append("APOSTILAMENTO em seu CERTIFICADO DE REGISTRO n: ").append(license.getNumRegister())
            .append(" para a incluso das atividades:");

    for (CharterTypeEntity charterType : listCharterType) {
        sb.append(charterType.getName()).append(", ");
    }

    sb.append(
            " em todos os produtos produtos j listados no Certificado de Registro, de acordo com o artigo 96 do Regulamento")
            .append(" aprovado pelo Decreto nmero 3.665, de 20 de novembro de 2000, para fiscalizao de produtos controlados (R-105) ")
            .append(" e legislao complementar");

    Paragraph paragraph = new Paragraph(sb.toString());
    paragraph.setFont(FONT_PARAGRAPH);

    doc.add(Chunk.NEWLINE);
    doc.add(paragraph);
    doc.add(Chunk.NEWLINE);

}

From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseExercitoPDF.java

/**
 * Incluso de Produtos/*  w ww  . j  a v  a  2  s  . c om*/
 * 
 * @param doc
 * @param license
 * @param listProducts
 * @throws DocumentException
 */
private void createIncludeProduct(Document doc, LicenseEXEntity license,
        List<LicenseExCharterProductEntity> listProducts) throws DocumentException {

    if (listProducts == null || listProducts.isEmpty()) {
        return;
    }

    StringBuilder sb = new StringBuilder().append(numLine++).append("-) ")
            .append("APOSTILAMENTO em seu CERTIFICADO DE REGISTRO n: ").append(license.getNumRegister())
            .append(" para a incluso dos seguintes produtos:").append(WINDOWS_LINE_SEPARATOR);

    for (LicenseExCharterProductEntity productCharter : listProducts) {
        sb.append(productCharter.getProduct().getOrder()).append(" - ")
                .append(productCharter.getProduct().getName()).append(" - ")
                .append(productCharter.getQtdProduct()).append(" - ").append(productCharter.getTypeQtdProduct())
                .append(WINDOWS_LINE_SEPARATOR);
    }

    sb.append(
            "Para todas as atividades j cadastradas no Certificado de Registro, de acordo  com o Artigo 96 do Regulamento ")
            .append("aprovado pelo Decreto No. 3.665, de 20 de Novembro de 2000, para a fiscalizao de Produtos Controlados (R-105) ")
            .append("e legislao complementar.");

    Paragraph paragraph = new Paragraph(sb.toString());
    paragraph.setFont(FONT_PARAGRAPH);

    doc.add(Chunk.NEWLINE);
    doc.add(paragraph);
    doc.add(Chunk.NEWLINE);

}

From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseExercitoPDF.java

/**
 * Alteraes Cadastrais//from   www .  j  a  v  a 2s  .c o  m
 * 
 * @param doc
 * @param license
 * @param listProducts
 * @throws DocumentException
 */
private void createAlterLicense(Document doc, LicenseEXEntity license, String text, String type)
        throws DocumentException {

    if (StringUtils.isEmpty(text)) {
        return;
    }

    StringBuilder sb = new StringBuilder().append(numLine++).append("-) ").append("CORREO de ").append(type)
            .append(" em seu CERTIFICADO DE REGISTRO n:").append(license.getNumRegister()).append(" para: ")
            .append(text).append(" conforme cadastrado junto a Prefeitura da Cidade de ")
            .append(license.getCompany().getCity()).append("/").append(license.getCompany().getState())
            .append(" e Receita Federal.");

    Paragraph paragraph = new Paragraph(sb.toString());
    paragraph.setFont(FONT_PARAGRAPH);

    doc.add(Chunk.NEWLINE);
    doc.add(paragraph);
    doc.add(Chunk.NEWLINE);

}

From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseExercitoPDF.java

private void createSignature(Document doc, LicenseEXEntity license) throws DocumentException {

    StringBuilder sbTerms = new StringBuilder().append("Nestes termos").append(WINDOWS_LINE_SEPARATOR)
            .append(" Pede deferimento.");

    StringBuilder sbDate = new StringBuilder().append(license.getCompany().getCity()).append("/")
            .append(license.getCompany().getState()).append(", ")
            .append(DateUtils.format(Calendar.getInstance()));

    StringBuilder sbSignature = new StringBuilder().append("____________________________________________")
            .append(WINDOWS_LINE_SEPARATOR).append(license.getCompany().getName())
            .append(WINDOWS_LINE_SEPARATOR).append(license.getCompany().getUserResponsable().getName())
            .append(" - ").append(license.getCompany().getUserResponsable().getOffice());

    Paragraph paragraphTerms = new Paragraph(sbTerms.toString());
    paragraphTerms.setFont(FONT_PARAGRAPH);
    paragraphTerms.setAlignment(Element.ALIGN_CENTER);

    Paragraph paragraphDate = new Paragraph(sbDate.toString());
    paragraphDate.setFont(FONT_PARAGRAPH);

    Paragraph paragraphSignature = new Paragraph(sbSignature.toString());
    paragraphSignature.setFont(FONT_PARAGRAPH);
    paragraphSignature.setAlignment(Element.ALIGN_CENTER);

    doc.add(Chunk.NEWLINE);
    doc.add(paragraphTerms);/*from   w  w w  .  j a  va2 s  . c  o m*/
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphDate);
    doc.add(Chunk.NEWLINE);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphSignature);
    doc.add(Chunk.NEWLINE);

}