【问题标题】:aspose word add style doesn't work假设单词添加样式不起作用
【发布时间】:2017-12-12 05:54:20
【问题描述】:

我在 doc 中添加了一个样式,但是如果样式字体名称安装在 word 上它不起作用!!! 我的字体是 PersianFont

 Document doc = new Document();
     DocumentBuilder builder = new DocumentBuilder(doc);     
     Aspose.Words.Style style = doc.Styles.Add(StyleType.Paragraph, "newStyle");
     style.IsQuickStyle = true;
     style.Font.Size = 24;
      style.Font.Name = "B Mitra";


 builder.ParagraphFormat.Style = style;  
    builder.Writeln("سلام");

【问题讨论】:

  • 请尝试latest version of Aspose.Words for .NET i.e. 17.12。另外,请确保在您将文档保存为 PDF 的机器上安装了该字体。如果问题仍然存在,请将您的 字体文件 和 Aspose.Words 生成的 PDF 压缩并上传到 Dropbox,并在此处分享下载链接以进行测试。我与 Aspose 一起担任开发人员宣传员。

标签: c# aspose.words


【解决方案1】:
Document doc = new Document();
     DocumentBuilder builder = new DocumentBuilder(doc);     
     Aspose.Words.Style style = doc.Styles.Add(StyleType.Paragraph, "newStyle");
     style.IsQuickStyle = true;
     style.Font.Size = 24;
     style.Font.SizeBi= 24;
     style.Font.Name = "B Mitra";
     style.Font.NameBi= "B Mitra";

 builder.ParagraphFormat.Style = style;  
    builder.Writeln("سلام");

【讨论】:

  • 感谢分享!对于这篇文章的未来读者,诀窍是设置 Bidrectional 字体属性 NameBi/SizeBi
猜你喜欢
  • 1970-01-01
  • 2014-02-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多