internal bool FitsPage(PdfPTable table, float margin)
{
if (!table.LockedWidth) {
float totalWidth = (IndentRight - IndentLeft) * table.WidthPercentage / 100;
table.TotalWidth = totalWidth;
}
// ensuring that a new line has been started.
EnsureNewLine();
float spaceNeeded = table.SkipFirstHeader ? table.TotalHeight - table.HeaderHeight : table.TotalHeight;
return spaceNeeded + (currentHeight > 0 ? table.SpacingBefore : 0f)
<= IndentTop - currentHeight - IndentBottom - margin;
}