1
Reply

Table positioning in PDF page using iTextSharp

Jak Balikai

Jak Balikai

Jun 8 2016 12:49 AM
861

I am adding hundreds of tables one after the other to the PDF document using iTextSharp. But the problem with this is we don't know when to create new page. And sometimes half of the table goes to the next page and half remain in the current page.Is there any way I can have last written data location so that I can decide whether to create new page or not.

I found some codes on StackOverFlow but none worked for me. I tried to get location using below code before adding new data to the document.

float y=writer.GetVerticalPosition(false); if(y<=document.document.BottomMargin) {   document.NewPage(); }

Please help me if any one knows how to do this.


Answers (1)