I want to know, how can I do make a page break in PDFPTable but I don't want it cut the table just after the table header ?
And I want to define a size to the body of my page but I don't know how can I make that can you help me please ?
I want to know, how can I do make a page break in PDFPTable but I don't want it cut the table just after the table header ?
And I want to define a size to the body of my page but I don't know how can I make that can you help me please ?
According to this, no, you cannot manually force a page break within a table. Your primary alternatives are to either just make multiple tables or use WriteSelectedRows
. If you are forcing a page break then you generally "know when" you want to do it so either option should work. Multiple tables allow you to still leverage iTextSharp's flow logic whereas WriteSelectedRows
gives you more control but assumes you have calculated if things actually fit. See this for a sample of using WriteSelectedRows
.
To control the document's size you can either use the constructor to Document
which optionally takes a Rectangle
and a margin or you can call SetPageSize
on the Document
if you want to control it per-page.