【问题标题】:Xceed word get paragraph font propertiesXceed word 获取段落字体属性
【发布时间】:2018-06-28 12:57:25
【问题描述】:

我需要从下面提到的段落(标题1)中获取颜色、字体大小和字体。 我查看了How get paragraph FontName with Docx dll?,但字体详细信息和颜色返回 null/empty。

任何帮助或建议将不胜感激。

                dummyDocument.ApplyTemplate(wordStyleTemplate);
                dummyDocument.InsertParagraph("Heading1").StyleName = "Heading1";

                dummyDocument.Save();
                dummyDocument.SaveAs(@"C:\DEV\StyleTest.docx");

                var templateHeading1 = dummyDocument.Paragraphs.ToList().FirstOrDefault(x => x.StyleName == "Heading1");
                var color = templateHeading1.MagicText[0].formatting.FontColor; //returns null

【问题讨论】:

    标签: c# ms-word xceed


    【解决方案1】:

    我最终使用this Open Xml example获取了word文档的整个样式表,然后提取了需要的样式。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-15
      • 1970-01-01
      • 2013-06-20
      • 2021-08-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多