float[] columnWidths = new float[] {38f, 105f, 90f}; PdfPTable table_SectionTwo= new PdfPTable(clmnWdthTpHdr); table_SectionTwo.setTotalWidth(500.0f); table_SectionTwo.setWidthPercentage(100.0f); table_SectionTwo.setLockedWidth(true);
// we create a table that spans the width of the page and that has 99 rows PdfPTable table = new PdfPTable(1); table.setTotalWidth(523); for (int i = 1; i < 100; i++) table.addCell("row " + i);
PdfPTable table = new PdfPTable(2); table.setTotalWidth(new float[]{ 72, 216 }); table.setLockedWidth(true);
PdfPTable table = new PdfPTable(2); table.setTotalWidth(288); table.setLockedWidth(true);
private void setWidthIfNecessary() { if ( layoutTable.getTotalWidth() != sectionParent.getWidthLimit() ) { layoutTable.setTotalWidth( sectionParent.getWidthLimit() ); } }
private PdfPTable getProgramStageMainTable() { PdfPTable mainTable = new PdfPTable( 1 ); // Code 1 mainTable.setTotalWidth( 800f ); mainTable.setLockedWidth( true ); mainTable.setHorizontalAlignment( Element.ALIGN_LEFT ); return mainTable; }
private void setWidthIfNecessary() { if ( layoutTable.getTotalWidth() != sectionParent.getWidthLimit() ) { layoutTable.setTotalWidth( sectionParent.getWidthLimit() ); } }
PdfPTable table = new PdfPTable(1); table.setTotalWidth(450); PdfTemplate template = cb.createTemplate(30, 30); template .setLineWidth(0.5f); template .rectangle(0, 0, 17f, 17f); template .stroke(); Image img = Image.getInstance(template); Chunk chunk = new Chunk(img, 1f, 1f); PdfPCell cell = new PdfPCell(); cell.addElement(chunk); table.addCell(cell);
private void setWidthIfNecessary() { if ( layoutTable.getTotalWidth() != sectionParent.getWidthLimit() ) { layoutTable.setTotalWidth( sectionParent.getWidthLimit() ); } }
private void setWidthIfNecessary() { if ( layoutTable.getTotalWidth() != sectionParent.getWidthLimit() ) { layoutTable.setTotalWidth( sectionParent.getWidthLimit() ); } }
PdfPTable tableFactura = new PdfPTable(4); tableFactura.setLockedWidth(true); tableFactura.setTotalWidth(425f); tableFactura.setWidths(new int[]{55, 15, 15, 15});
PdfPTable outerTable = new PdfPTable(1); outerTable.setSpacingAfter(0); outerTable.setSpacingBefore(0); outerTable.setTotalWidth(document.right() - document.left()); outerTable.setLockedWidth(true);
PdfPTable table = new PdfPTable(1); table.setTotalWidth(523); PdfPCell cell = new PdfPCell(new Phrase("This is a test document")); cell.setBackgroundColor(BaseColor.ORANGE); table.addCell(cell); cell = new PdfPCell(new Phrase("This is a copyright notice")); cell.setBackgroundColor(BaseColor.LIGHT_GRAY); table.addCell(cell);
Image image = Image.getInstance(IMG); image.setScaleToFitHeight(false); PdfPTable table = new PdfPTable(1); table.setTotalWidth(new float[]{120}); table.setLockedWidth(true); Phrase listOfDots = new Phrase(); for (int i = 0; i < 40; i++) { listOfDots.add(new Chunk(image, 0, 0)); listOfDots.add(new Chunk(" ")); } table.addCell(listOfDots);
Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream("datamatrix.pdf")); document.open(); PdfPTable table = new PdfPTable(2); table.setHorizontalAlignment(Element.ALIGN_LEFT); table.setTotalWidth(100); table.setLockedWidth(true); table.addCell("1"); BarcodeDatamatrix dm = new BarcodeDatamatrix(); dm.generate("1234567890"); Image img = dm.createImage(); PdfPCell cell = new PdfPCell(img, false); cell.setPadding(2); table.addCell(cell);; document.add(table); document.close();
private void writeFooterTable(PdfWriter writer, Document document, PdfPTable table) { final int FIRST_ROW = 0; final int LAST_ROW = -1; //Table must have absolute width set. if(table.getTotalWidth()==0) table.setTotalWidth((document.right()-document.left())*table.getWidthPercentage()/100f); table.writeSelectedRows(FIRST_ROW, LAST_ROW, document.left(), document.bottom()+table.getTotalHeight(),writer.getDirectContent()); }
private void formatTable(final PdfPTable table) { Rectangle page = document.getPageSize(); table.getDefaultCell().setVerticalAlignment(PdfCell.ALIGN_MIDDLE); table.getDefaultCell().setPaddingBottom(tablePaddingBottom); table.getDefaultCell().setHorizontalAlignment(PdfCell.ALIGN_CENTER); table.setTotalWidth(page.getWidth() - document.leftMargin() - document.rightMargin()); table.setSpacingBefore(20); }
private PdfPTable createTable( PdfPCell cell ) { PdfPTable table = new PdfPTable( 1 ); table.setSpacingBefore( this.spacingBefore() ); table.setSpacingAfter( this.spacingAfter() ); table.setHorizontalAlignment( this.getHorizontalAlignment() ); table.setTotalWidth( cell.getPaddingLeft() + this.getTotalWidth() + cell.getPaddingRight() ); table.setLockedWidth( true ); table.setSplitLate( false ); table.addCell( cell ); return table; }
private PdfPTable createTable( PdfPCell cell ) { PdfPTable table = new PdfPTable( 1 ); table.setSpacingBefore( this.spacingBefore() ); table.setSpacingAfter( this.spacingAfter() ); table.setHorizontalAlignment( this.getHorizontalAlignment() ); table.setTotalWidth( cell.getPaddingLeft() + this.getTotalWidth() + cell.getPaddingRight() ); table.setLockedWidth( true ); table.setSplitLate( false ); table.addCell( cell ); return table; }
public Toc() { toc = new Document(PageSize.A4, 50, 50, 110, 50); content = new PdfPTable(2); Rectangle page = toc.getPageSize(); content.setTotalWidth(page.getWidth() - toc.leftMargin() - toc.rightMargin()); content.getDefaultCell().setUseVariableBorders(true); content.getDefaultCell().setBorderColorBottom(Color.WHITE); content.getDefaultCell().setBorderColorRight(Color.WHITE); content.getDefaultCell().setBorderColorLeft(Color.WHITE); content.getDefaultCell().setBorderColorTop(Color.WHITE); content.getDefaultCell().setBorderWidthBottom(2f); }