Example usage for com.itextpdf.text Element ALIGN_CENTER

List of usage examples for com.itextpdf.text Element ALIGN_CENTER

Introduction

In this page you can find the example usage for com.itextpdf.text Element ALIGN_CENTER.

Prototype

int ALIGN_CENTER

To view the source code for com.itextpdf.text Element ALIGN_CENTER.

Click Source Link

Document

A possible value for paragraph alignment.

Usage

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

License:Open Source License

private void createParagraph(Document doc, LicensePCEntity license, String type,
        List<LicensePCProductEntity> listProducts) throws DocumentException {

    StringBuilder sbParagraph = new StringBuilder().append("A sociedade empresria ")
            .append(license.getCompany().getName()).append(", estabelecida em ")
            .append(license.getCompany().getStreet()).append(", com ramo de ")
            .append(license.getCompany().getCodCnae()).append(", telefone ")
            .append(license.getCompany().getPhoneNumber()).append(", fax ")
            .append(license.getCompany().getFaxNumber()).append(", e-mail: ")
            .append(license.getCompany().getUserResponsable().getEmail()).append(" e CEP ")
            .append(license.getCompany().getCep()).append(", com CNPJ N")
            .append(license.getCompany().getCnpjFormatted()).append("e inscrio Estadual N")
            .append(license.getCompany().getNumInscription()).append(", atravs de seu ")
            .append(license.getCompany().getUserResponsable().getOffice()).append(", Sr. ")
            .append(license.getCompany().getUserResponsable().getName())
            .append(", vem respeitosamente requerer de V. Ex. a ALTERAO de seu:")
            .append(WINDOWS_LINE_SEPARATOR)
            .append("Certificado de Vistoria para Produtos Controlados, fixando-se sua capacidade nos seguintes limites mximos ")
            .append("de estoque: (Conforme relao em Anexo)").append(WINDOWS_LINE_SEPARATOR)
            .append("De acordo com o Decreto No 6.911 de 10 de Janeiro de 1935.");

    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("Nome: ")
            .append(license.getCompany().getUserResponsable().getName()).append(WINDOWS_LINE_SEPARATOR)
            .append("Cargo: ").append(license.getCompany().getUserResponsable().getOffice())
            .append(WINDOWS_LINE_SEPARATOR).append("RG: ")
            .append(license.getCompany().getUserResponsable().getRg()).append(WINDOWS_LINE_SEPARATOR)
            .append("CPF: ").append(license.getCompany().getUserResponsable().getCpf());

    // Header//w  w  w  . ja  va 2s. c  om
    Paragraph paragraphHeader = new Paragraph("DEPARTAMENTO DE IDENTIFICAO E REGISTROS DIVERSOS  DIRD "
            + "DIVISO DE PRODUTOS CONTROLADOS  DPC");
    paragraphHeader.setFont(FONT_HEADER);
    paragraphHeader.setAlignment(Element.ALIGN_CENTER);

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

    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(paragraphHeader);
    doc.add(Chunk.NEWLINE);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphCompany);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphTerms);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphDate);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphSignature);
    doc.add(Chunk.NEWLINE);

    this.generateProducts(doc, listProducts);

}

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

License:Open Source License

private void generateProducts(Document doc, List<LicensePCProductEntity> listProducts)
        throws DocumentException {

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

    // specify column widths
    float[] columnWidths = { 2f, 2f, 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);/*  ww  w.  j  a v a2 s.c o m*/

    // insert column headings
    insertCell(table, "Nome da Substncia de Controle", Element.ALIGN_CENTER, FONT_PARAGRAPH);
    insertCell(table, "Volume mximo de estoque", Element.ALIGN_CENTER, FONT_PARAGRAPH);
    insertCell(table, "Unidade de medida", Element.ALIGN_CENTER, FONT_PARAGRAPH);

    table.setHeaderRows(1);

    for (LicensePCProductEntity product : listProducts) {

        // Cria a tabela com os Produtos
        insertCell(table, product.getProduct().getName(), Element.ALIGN_LEFT, FONT_PARAGRAPH);
        insertCell(table, dc.format(product.getQtdProduct()), Element.ALIGN_LEFT, FONT_PARAGRAPH);
        insertCell(table, product.getTypeQtdProduct(), Element.ALIGN_LEFT, FONT_PARAGRAPH);
    }

    doc.add(Chunk.NEXTPAGE);
    doc.add(table);
}

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

License:Open Source License

private void createProductsTable(Document doc) throws DocumentException {

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

    // specify column widths
    float[] columnWidths = { 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);//from  ww  w. j a va  2s.  c om

    // insert column headings
    insertCell(table, "PRODUTO", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "SALDO DO TRIMESTRE ANTERIOR", Element.ALIGN_CENTER, fontHeaderTableSmall);
    insertCell(table, "COMPRAS", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "VENDAS", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "CONSUMO", Element.ALIGN_CENTER, fontHeaderTable);
    insertCell(table, "ESTOQUE PARA O TRIMESTRE SEGUINTE", Element.ALIGN_CENTER, fontHeaderTableSmall);

    table.setHeaderRows(1);

    for (InvoiceInventoryMapEntity productMap : listProductMapVO) {

        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, dc.format(productMap.getQtdInventoryPreviusTrimester()), Element.ALIGN_CENTER,
                fontHeaderTableSmall);
        insertCell(table, dc.format(productMap.getQtdBuyProduct()), Element.ALIGN_CENTER, fontHeaderTableSmall);
        insertCell(table, dc.format(productMap.getQtdSellProduct()), Element.ALIGN_CENTER,
                fontHeaderTableSmall);
        insertCell(table, dc.format(productMap.getQtdUtilization()), Element.ALIGN_CENTER,
                fontHeaderTableSmall);
        insertCell(table, dc.format(qtdNextPeriod), Element.ALIGN_CENTER, fontHeaderTableSmall);
    }

    doc.add(table);
}

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

License:Open Source License

private void createInvoiceTable(Document doc) throws DocumentException {

    doc.add(Chunk.NEWLINE);// w  ww  .j  a  v  a  2  s .  c  o m

    // 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);

    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 createProductsTable(Document doc) throws DocumentException {

    Paragraph paragraph = new Paragraph("RESUMO GERAL");
    paragraph.setFont(fontText);/*from ww  w  .j  a  va  2 s  .co m*/

    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//  ww w .  j  a v a 2 s.  c o m
    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());

    }//  w w w  .  j ava 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

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);//from   www  . j  a  v a2s .com
    doc.add(paragraphTerms);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphDate);
    doc.add(Chunk.NEWLINE);
    doc.add(Chunk.NEWLINE);
    doc.add(paragraphSignature);
    doc.add(Chunk.NEWLINE);

}

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

private void insertCellProtocol(PdfPTable table, LicensePFEntity license) {

    PdfPTable tableProtocol = new PdfPTable(1);
    tableProtocol.setWidthPercentage(100f);

    Paragraph officialPhrase = new Paragraph("USO OFICIAL" + SEPARATOR, FONT_PARAGRAPH);
    officialPhrase.setAlignment(Element.ALIGN_LEFT);

    Paragraph protocolPhrase = new Paragraph("ETIQUETA PROTOCOLO" + SEPARATOR_DOUBLE + SEPARATOR_DOUBLE
            + SEPARATOR_DOUBLE + SEPARATOR_DOUBLE + SEPARATOR_DOUBLE + SEPARATOR, FONT_PROTOCOL);
    protocolPhrase.setAlignment(Element.ALIGN_LEFT);

    Paragraph obsPhrase = new Paragraph("Observao Importante!" + SEPARATOR, FONT_HEADER);

    Paragraph obsStringPhrase = new Paragraph(
            "Protocolar este Anexo somente quando no conjugado com a alterao efetiva ou a renovao da licena.",
            FONT_PARAGRAPH);//from   w w w  . j av a 2s  . c  om

    Paragraph fullPhrase = new Paragraph();
    fullPhrase.add(officialPhrase);
    fullPhrase.add(protocolPhrase);
    fullPhrase.add(obsPhrase);
    fullPhrase.add(obsStringPhrase);

    PdfPCell cell = new PdfPCell(fullPhrase);

    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setPadding(5f);

    tableProtocol.addCell(cell);

    PdfPCell cellProtocol = new PdfPCell(tableProtocol);
    cellProtocol.setColspan(2);

    table.addCell(cellProtocol);
    table.addCell(this.createCellEtiqueta(license));
}

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

private void insertCellAlteracao(PdfPTable table, String text) {

    if (text == null) {
        text = "";
    }/*  w  ww .j  a v a 2  s.c  o m*/

    // create a new cell with the specified Text and Font
    PdfPCell cell = new PdfPCell(new Phrase(text.trim(), FONT_HEADER));
    // set the cell alignment
    // in case there is no text and you wan to create an empty row
    if (text.trim().equalsIgnoreCase("")) {
        cell.setMinimumHeight(10f);
    }

    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setColspan(2);
    cell.setBackgroundColor(BaseColor.LIGHT_GRAY);

    // add the call to the table
    table.addCell(cell);
}