/** * @param rectangle * @param spacing * @return a rectangle */ public static SimpleTable GetDimensionlessInstance(Rectangle rectangle, float spacing) { SimpleTable ev = new SimpleTable(); ev.CloneNonPositionParameters(rectangle); ev.Cellspacing = spacing; return(ev); }
/** * Create a PdfPTable based on this Table object. * @return a PdfPTable object * @throws BadElementException */ public PdfPTable CreatePdfPTable() { if (!convert2pdfptable) { throw new BadElementException("No error, just an old style table"); } AutoFillEmptyCells = true; Complete(); PdfPTable pdfptable = new PdfPTable(widths); pdfptable.ElementComplete = complete; if (NotAddedYet) pdfptable.SkipFirstHeader = true; SimpleTable t_evt = new SimpleTable(); t_evt.CloneNonPositionParameters(this); t_evt.Cellspacing = cellspacing; pdfptable.TableEvent = t_evt; pdfptable.HeaderRows = lastHeaderRow + 1; pdfptable.SplitLate = cellsFitPage; pdfptable.KeepTogether = tableFitsPage; if (!float.IsNaN(offset)) { pdfptable.SpacingBefore = offset; } pdfptable.HorizontalAlignment = alignment; if (locked) { pdfptable.TotalWidth = width; pdfptable.LockedWidth = true; } else { pdfptable.WidthPercentage = width; } foreach (Row row in this) { IElement cell; PdfPCell pcell; for (int i = 0; i < row.Columns; i++) { if ((cell = (IElement)row.GetCell(i)) != null) { if (cell is Table) { pcell = new PdfPCell(((Table)cell).CreatePdfPTable()); } else if (cell is Cell) { pcell = ((Cell)cell).CreatePdfPCell(); pcell.Padding = cellpadding + cellspacing / 2f; SimpleCell c_evt = new SimpleCell(SimpleCell.CELL); c_evt.CloneNonPositionParameters((Cell)cell); c_evt.Spacing = cellspacing * 2f; pcell.CellEvent = c_evt; } else { pcell = new PdfPCell(); } pdfptable.AddCell(pcell); } } } return pdfptable; }
/** * @param rectangle * @param spacing * @return a rectangle */ public static SimpleTable GetDimensionlessInstance(Rectangle rectangle, float spacing) { SimpleTable ev = new SimpleTable(); ev.CloneNonPositionParameters(rectangle); ev.Cellspacing = spacing; return ev; }