/// <summary> /// Inserts the header. /// </summary> /// <param name="content">The content.</param> /// <param name="document">The document.</param> public void InsertHeader(Paragraph content, TextDocument document) { bool exist = true; XElement node = Styles.Descendants(Ns.Office + "master-styles") .Elements(Ns.Style + "master-page") .Elements(Ns.Style + "header").FirstOrDefault(); if (node != null) { node.Value = ""; } else { node = new XElement(Ns.Style + "header"); exist = false; } node.Add(new XElement(content.Node)); if (!exist) { Styles.Descendants(Ns.Office + "master-styles") .Elements(Ns.Style + "master-page").First().Add(node); } InsertParagraphStyle(content); }
/// <summary> /// Gets the HTML footer. /// </summary> /// <param name="document">The document.</param> /// <returns>The html string which represent the document footer.</returns> public string GetHtmlFooter(TextDocument document) { const string html = ""; XElement node = Styles.Descendants(Ns.Office + "master-styles") .Elements(Ns.Style + "master-page") .Elements(Ns.Style + "footer").FirstOrDefault(); if (node != null) { } return(html); }
/// <summary> /// Inserts the paragraph style. /// </summary> /// <param name="content">The content.</param> private void InsertParagraphStyle(Paragraph content) { if (content.Style != null) { Styles.Descendants(Ns.Office + "styles").First().Add(new XElement(content.Style.Node)); } if (content.TextContent != null) { foreach (IText it in content.TextContent) { if (it is FormatedText) { Styles.Descendants(Ns.Office + "styles").First().Add(new XElement(it.Style.Node)); } } } }
/// <summary> /// Inserts the office master styles node into this XML style document. /// </summary> /// <param name="aOfficeMasterStyleNode">A office master style node.</param> public virtual void InsertOfficeMasterStylesNode(XElement aOfficeMasterStyleNode) { Styles.Descendants(Ns.Office + "master-styles").First().Add(aOfficeMasterStyleNode); }
/// <summary> /// Inserts the office automatic styles node into this XML style document. /// </summary> /// <param name="aOfficeAutomaticStyleNode">A office automatic style node.</param> public virtual void InsertOfficeAutomaticStylesNode(XElement aOfficeAutomaticStyleNode) { Styles.Descendants(Ns.Office + "automatic-styles").First().Add(aOfficeAutomaticStyleNode); }
/// <summary> /// Inserts the office styles node into this XML style document. /// </summary> /// <param name="aStyleNode">A style node.</param> public virtual void InsertOfficeStylesNode(XElement aStyleNode) { Styles.Descendants(Ns.Office + "styles").First().Add(aStyleNode); }
private IReadOnlyCollection <DqStyle> GetStyles(Styles wStyles, DqNumberingTable dqNumberingsTable, DqFontScheme dqFontScheme) => wStyles.Descendants <Style>().Select(wStyle => ConvertStyle(wStyle, dqNumberingsTable, dqFontScheme)).ToList();