protected internal float FlushLines()
{
// checks if the ArrayList with the lines is not null
if (lines == null) {
return 0;
}
// checks if a new Line has to be made.
if (line != null && line.Size > 0) {
lines.Add(line);
line = new PdfLine(IndentLeft, IndentRight, alignment, leading);
}
// checks if the ArrayList with the lines is empty
if (lines.Count == 0) {
return 0;
}
// initialisation of some parameters
Object[] currentValues = new Object[2];
PdfFont currentFont = null;
float displacement = 0;
currentValues[1] = (float)0;
// looping over all the lines
foreach (PdfLine l in lines) {
// this is a line in the loop
float moveTextX = l.IndentLeft - IndentLeft + indentation.indentLeft + indentation.listIndentLeft + indentation.sectionIndentLeft;
text.MoveText(moveTextX, -l.Height);
// is the line preceeded by a symbol?
if (l.ListSymbol != null) {
ColumnText.ShowTextAligned(graphics, Element.ALIGN_LEFT, new Phrase(l.ListSymbol), text.XTLM - l.ListIndent, text.YTLM, 0);
}
currentValues[0] = currentFont;
WriteLineToContent(l, text, graphics, currentValues, writer.SpaceCharRatio);
currentFont = (PdfFont)currentValues[0];
displacement += l.Height;
text.MoveText(-moveTextX, 0);
}
lines = new List<PdfLine>();
return displacement;
}