/// <summary>
/// Gets the text contents.
/// </summary>
/// <param name="textCollection">The text collection.</param>
/// <returns>The content. ArrayList of chunks and phrases.</returns>
public static ICollection GetTextContents(ITextCollection textCollection, iTextSharp.text.Font font)
{
try
{
ArrayList contents = new ArrayList();
foreach (object obj in textCollection)
{
if (obj is AODL.Document.Content.Text.FormatedText)
{
contents.Add(FormatedTextConverter.Convert(
obj as AODL.Document.Content.Text.FormatedText));
}
else if (obj is AODL.Document.Content.Text.SimpleText)
{
contents.Add(SimpleTextConverter.Convert(
obj as AODL.Document.Content.Text.SimpleText, font));
}
else if (obj is AODL.Document.Content.Text.TextControl.TabStop)
{
contents.Add(SimpleTextConverter.ConvertTabs(
obj as AODL.Document.Content.Text.TextControl.TabStop, font));
}
else if (obj is AODL.Document.Content.Text.TextControl.WhiteSpace)
{
contents.Add(SimpleTextConverter.ConvertWhiteSpaces(
obj as AODL.Document.Content.Text.TextControl.WhiteSpace, font));
}
}
return(contents);
}
catch (Exception ex)
{
throw;
}
}