private float AddText(string[] chunks, iTextSharp.text.Font font, float spacingBefore, float spacingAfter, int alignment, float lineHightMultiplier, Document doc)
{
int count = 0;
float height = 0;
var paragraph = new Paragraph();
float fontSize = font.Size * lineHightMultiplier;
var phrase = new Phrase();
foreach(string item in chunks)
{
if (string.IsNullOrEmpty(item)) continue;
var chunk = new Chunk(item + Environment.NewLine, font);
chunk.setLineHeight(fontSize);
phrase.Add(chunk);
count++;
}
if (count > 0)
{
paragraph.Add(phrase);
paragraph.Alignment = alignment;
paragraph.SpacingBefore = spacingBefore;
paragraph.SpacingAfter = spacingAfter;
doc.Add(paragraph);
height = spacingBefore + spacingAfter + count * fontSize;
}
return height;
}