internal void FlushFloatingElements()
{
if (floatingElements != null && floatingElements.Count > 0) {
List<IElement> cashedFloatingElements = floatingElements;
floatingElements = null;
FloatLayout fl = new FloatLayout(writer.DirectContent, cashedFloatingElements);
int loop = 0;
while (true) {
fl.SetSimpleColumn(IndentLeft, IndentBottom, IndentRight, IndentTop - currentHeight);
try {
int status = fl.layout(false);
if ((status & ColumnText.NO_MORE_TEXT) != 0) {
text.MoveText(0, fl.getYLine() - IndentTop + currentHeight);
currentHeight = IndentTop - fl.getYLine();
break;
}
} catch(Exception) {
return;
}
if (IndentTop - currentHeight == fl.getYLine() || PageEmpty)
++loop;
else {
loop = 0;
}
if (loop == 2) {
return;
}
NewPage();
}
}
}