I'm starting with itextsharp and wondering if there is any reason why if I set the font of a phrase after the construction it doesn't work. Is there any reason, do I miss something?
iTextSharp.text.Font f = PdfFontFactory.GetComic();
f.SetStyle(PdfFontStyle.BOLD);
Color c = Color.DarkRed;
f.SetColor(c.R,c.G,c.B);
f.Size = 20;
Document document = new Document();
try
{
PdfWriter.GetInstance(document, new System.IO.FileStream("PhraseTest.pdf", FileMode.Create));
document.SetPageSize(PageSize.A4);
document.Open();
Phrase titreFormules = new Phrase("Nos formules",f); //THIS WORKS
// titreFormules.Font = f; // THIS DOESN'T WORK!
document.Add(titreFormules);
document.Close();