List of usage examples for com.itextpdf.text.pdf PdfPTable setExtendLastRow
public void setExtendLastRow(final boolean extendLastRows)
From source file:gov.nih.nci.firebird.service.registration.AbstractPdfWriterGenerator.java
License:Open Source License
private void addFooter() throws DocumentException { PdfPTable table = createTable(ONE_COLUMN); PdfPCell cell = createCell();//from w ww . j ava 2s . c o m table.setExtendLastRow(true); table.addCell(cell); document.add(table); addSignatureField(); }
From source file:nwk.com.br.documents.OrcamentoPdf.java
private PdfPTable dadosRodape(Orcamento orcamento) throws Exception { //tabela que pega com 100% do tamanho do arquivo, alinhada no centro com tres colunas e sem bordas PdfPTable rodape = new PdfPTable(new float[] { 0.5f, 0.2f, 0.3f }); rodape.setWidthPercentage(100.0f);//seta o tamanho da tabela em relaao ao documento rodape.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); rodape.getDefaultCell().setBorder(0); PdfPCell obs = new PdfPCell(new Paragraph("\n\n Observaes:\n" + orcamento.getObservacoes(), f)); PdfPCell ass = new PdfPCell(new Paragraph("\n\n_________________________\nAssinatura", f)); Font fonteAviso = new Font(Font.FontFamily.TIMES_ROMAN, 14, Font.BOLDITALIC); PdfPCell spc = new PdfPCell(new Paragraph(" ")); PdfPCell aviso = new PdfPCell(new Paragraph( "AGRADEEMOS A PREFERNCIA\nORAMENTO VALIDO SOMENTE PARA O DIA DE SUA CRIAO!", fonteAviso)); aviso.setHorizontalAlignment(Element.ALIGN_CENTER); obs.setHorizontalAlignment(Element.ALIGN_LEFT); ass.setHorizontalAlignment(Element.ALIGN_CENTER); obs.setBorder(0);//from w w w. j ava 2 s . c o m ass.setBorder(0); spc.setBorder(0); aviso.setBorder(0); spc.setColspan(3); aviso.setColspan(3); rodape.addCell(obs); rodape.addCell(new Paragraph(" ")); rodape.addCell(ass); rodape.addCell(spc); rodape.addCell(spc); rodape.addCell(spc); rodape.addCell(spc); rodape.addCell(aviso); //rodape.setExtendLastRow(true); //cria uma nova celula que recebe a tabela anterior PdfPCell otherCell = new PdfPCell(rodape); otherCell.setBorder(0); otherCell.setVerticalAlignment(Element.ALIGN_BOTTOM); otherCell.setHorizontalAlignment(Element.ALIGN_CENTER); //cria uma nova tabela que recebe a celula otherCell PdfPTable rodape2 = new PdfPTable(new float[] { 1.0f }); rodape2.setWidthPercentage(100.0f);//seta o tamanho da tabela em relaao ao documento rodape2.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); rodape2.getDefaultCell().setBorder(0); //estende a tabela at o fim da pagina, como o alinhamento horizontal dela bottom, ela fica toda no rodape rodape2.addCell(otherCell); rodape2.setExtendLastRow(true); return rodape2; }