Question

I am new to iText and am trying to figure something out and ANY help would be greatly appreciated.

I would like to generate a table that has n columns that should they not fit on one page, then have the remaining columns continue on the second page and so on.

Is there any way to do this with iText?

Thanks, Kirk

Was it helpful?

Solution

When you create a table, you ALWAYS know the width of the table, be it because you've defined the absolute width(s of the columns) yourself, or because you know the available width on the page in combination with the width percentage of the table.

Now it's up to you to distribute the columns over different pages. You can do this with the writeSelectedRows() method as shown in this example from my book.

Of course: it's more difficult than that simple example, as you'll also want to make sure the rows fit the height of the page, but that's another question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top