Hi. I m creating a table using iText. Each table has 2 columns and have no borders except for left most, right most, top most and bottom most side of the table. I am able to achieve this but the problem occurs when new page begins. I want the to draw a horizontal line to the table at the end of page and another horizontal line when it begins. I have tried using
@Override
public void onEndPage(PdfWriter arg0, Document arg1) {
PdfPCell pdfpcells[] = pdfptable.getRow(pdfptable.getRows().size()-1).getCells();
pdfpcells[0].setBorderWidthBottom(0.5f);
if(pdfpcells[1] != null){ //There is a possibility that there are odd number of elements
pdfpcells[1].setBorderWidthBottom(0.5f);
}
}
for drawing horizontal line at the end of page assuming this function is called every time page ends and hence uses current number of rows. pdfptable is declared as class variable. This doesn't seem to work. I am using latest version of iText. Thanks.