ITextSharp - How to add PDF PDF to PDFPTable?

I would like to add an array of PDFPCells to PDFPRow and then add PDF PDF to PDFPTable, but I cannot find a way in PDFPTable for this.

However, there is PDFPTable.AddCell

Any ideas?

+6
c # itextsharp
source share
1 answer

Check out the PdfPTable Rows.Add() method, which accepts PdfPRow, which you can build using the PdfPCells array.

Example:

 // ... PdfPTable table = new PdfPTable(5); PdfPCell[] cells = new PdfPCell[] { new PdfPCell(GetCell("c1")), new PdfPCell(GetCell("c2")), new PdfPCell(GetCell("c3")), new PdfPCell(GetCell("c4")), new PdfPCell(GetCell("c5"))}; PdfPRow row = new PdfPRow(cells); table.Rows.Add(row); // ... 

If the GetCell() method returns a PdfPCell .

+11
source share

All Articles