public static IElement GetElement(this HeaderBase hb)
{
Paragraph p = new Paragraph();
Font f = TextSharpFonts.SectionHeaderFont;
if (hb is TitleHeader)
{
f = TextSharpFonts.TitleHeaderFont;
p.Add(new Phrase(hb.Header, f));
p.Alignment = Element.ALIGN_CENTER;
p.Leading = f.Size * 2f;
p.SpacingAfter = f.Size * 1.5f;
}
if (hb is SectionHeader)
{
p.Add(new Phrase(hb.Header, f));
p.Leading = f.Size * 1.5f;
}
if (hb is ItemHeader)
{
p.Add(new Phrase(hb.Header, TextSharpFonts.ItemHeaderFont));
}
return p;
}