【问题标题】:Why is the font changed when exporting a word-file to pdf?为什么将word文件导出为pdf时字体会发生变化?
【发布时间】:2023-01-02 17:26:29
【问题描述】:

我们在 access-vba 中使用这段代码将我们的单词转换为 pdf:

    Set w_app = CreateObject("word.application")
    w_app.Documents.Open(fileName:="C:\Temp\Test.docx")
    w_app.ActiveDocument.ExportAsFixedFormat "c:\Temp\test.pdf", wdExportFormatPDF, _
                                             OpenAfterExport:=False, OptimizeFor:=wdExportOptimizeForPrint, _
                                             Range:=wdExportAllDocument, From:=1, To:=1, item:=wdExportDocumentContent, _
                                             IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:=wdExportCreateNoBookmarks, _
                                             DocStructureTags:=True, BitmapMissingFonts:=True, useIso19005_1:=false

但是当我们打开 pdf 时,所有使用字体“Ap​​ercu Pro”书写的文本都已更改为字体:“Segoe Script”。

当我们使用 Office-Word 手动导出文件时,不会出现这种情况。

奇怪的是,当 !not! 中的字体“Ap​​ercu Pro”时,它也能正常工作。安装在窗户上。

我们已经尝试过的:

  • 我们更改了 ExportAsFixedFormat 的每个参数 => 没有效果
  • 我们使用函数 ExportAsFixedFormat2 而不是 ExportAsFixedFormat => 无效
  • 尝试使用 w_app.ActiveDocument.SaveAs2("c:\Temp\test.pdf", EmbedTrueTypeFonts:=False) 而不是 ExportAsFixedFormat => 无效

【问题讨论】:

  • 您是否尝试过使用 VBA 宏记录器找出正确完成工作所需的参数?
  • 我无法重现这个问题。它在我的系统上有正确的字体
  • @Eugene Astafiev:不,我们没有。但我们会尝试的。
  • @mazoula:字体文件可能有问题。我们试图得到一个新的。
  • 无法复制表明您可能需要应用 Microsoft 修复并关闭和打开所有内容并重新检查您的步骤。我应该提到我在 Windows 上使用了 Access 2016。我忘记了我下载的一种 Apercu 字体。

标签: vba ms-access ms-word office-automation export-to-pdf


【解决方案1】:

我并没有真正找出问题所在,但我的解决方案是卸载字体的 .otf-Version(OpenType 格式)并安装 .ttf-Version(True type 格式)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-04-17
    • 1970-01-01
    • 1970-01-01
    • 2021-04-30
    • 2020-07-19
    • 1970-01-01
    • 2019-07-17
    • 2014-06-22
    相关资源
    最近更新 更多