Add Column to PdfPTable, iTextSharp

I am creating a PDF using iTextSharp. I see how to create a new table with multiple columns, but I still cannot dynamically add a new column. The problem I have is that I will not know the number of columns that I need right now, so they need to add them

Can someone please enlighten me, or will I have to re-create the table every time I need to add a column?

Thanks Mat

+3
source share
3 answers

Would it not be appropriate then to create an intermediate model that contains the table you need, and can it create a PDF table for you?

, , , , "" PdfPTable?

+2

PdfPTable , .

, , - ... , . . , , , , .

. .

, , ... " " . (String [] [] - ), , , , . , , , .

, /. . , .

0

ITextSharp - HTML- (, , ).

, , , , .

Suppose you created pdfptable with 5 columns. The 5th cell that you add will be in the first row, and the 6th cell will be in the 1st column of the second row.

The only drawback of this is the need to add lines in which not all cells are filled, but I usually get around this by simply adding an empty cell or a cell with a space in it.

-1
source

Source: https://habr.com/ru/post/1734577/


All Articles