c# - 转换为 pdf c# 时 word interop 嵌入字体

标签 c# office-interop

我正在使用以下方法将 word 保存为 pdf:

private Microsoft.Office.Interop.Word.Application _wordApp;

_wordApp.ActiveDocument.EmbedTrueTypeFonts = true;
_wordApp.ActiveDocument.SaveAs2(MergedDocumentFullOutputPath, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF);

我可以另存为 pdf,但很少有字体未嵌入。如果可能的话,我也想嵌入系统字体。

最佳答案

Word 2013-2016 不支持使用 Open Type Fonts (.otf) 或其他格式嵌入字体,仅完全支持使用 TrueType Fonts (.ttf)。

要解决此问题,您只需按照以下简单步骤操作即可:

  1. 使用转换器将字体转换为 .ttf。我用过这个网站 Online Font Converter .
  2. 安装转换后的文件。你会 提示字体已经安装,选择"is"替换 旧安装。
  3. 享受 :)

关于c# - 转换为 pdf c# 时 word interop 嵌入字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35630069/

相关文章:

c# - 如何在c#中重写多个else条件

c# - 如何将 lambda 表达式作为返回方法的参数?

c# - 卡住多个工作表中的 Pane C#

c# - 如何打开Outlook新邮件窗口c#

c# word interop 查找并替换所有内容

c# - 检测对象是否为 ValueTuple

c# - 练习web.config 报错

c# - 多种方法的线程同步

c# - 使用 Excel Interop 时,忽略 Excel 中设置的日期格式

c# - 最大行 Microsoft.Office.Interop.Word.Table