/// <summary> /// Creates the title pargraph. /// </summary> private void CreateTitlePargraph() { TitleParagraph = new Paragraph(Document, "Table_Of_Contents_Title"); TitleParagraph.TextContent.Add(new SimpleText(Document, Title)); //Set default styles TitleParagraph.ParagraphStyle.TextProperties.Bold = "bold"; TitleParagraph.ParagraphStyle.TextProperties.FontName = FontFamilies.Arial; TitleParagraph.ParagraphStyle.TextProperties.FontSize = "20pt"; //Add to the index title IndexBodyNode.Elements().ElementAt(0).Add(TitleParagraph.Node); }
/// <summary> /// Content was inserted. /// </summary> /// <param name="index">The index.</param> /// <param name="value">The value.</param> private void Content_Inserted(int index, object value) { IndexBodyNode.Add(((IContent)value).Node); }