【问题标题】:Convert Word to PDF - barcode font not displayed将 Word 转换为 PDF - 条码字体不显示
【发布时间】:2014-07-09 05:39:23
【问题描述】:

我正在使用Aspose.Words.dll 将word Doc 转换为PDF

这是我的代码

var fileName = System.AppDomain.CurrentDomain.BaseDirectory 
               + Guid.NewGuid().ToString();
File.WriteAllBytes(fileName + ".docx", wordBytes);
var doc = new Aspose.Words.Document(fileName + ".docx");
doc.Save(fileName + ".pdf");

如果我运行上面的代码它成功地将 Word 转换为 PDF

但我的问题是我的单词中有条形码字体,而 PDF 中没有显示。尽管有条形码,但它会在 PDF 文档中显示字母。

我的系统中安装了所有字体。

我也尝试过如下,

var saveOptions = new PdfSaveOptions();
saveOptions.EmbedFullFonts = true;
doc.Save(fileName + ".pdf", saveOptions);

但什么都不会发生。

谁能帮我解决这个问题?

【问题讨论】:

    标签: pdf .net-3.5 docx aspose.words


    【解决方案1】:

    如果您在共享服务器下转换文档,那么很可能是安全问题。 Aspose.Words for .NET DLL 需要访问 Windows 注册表才能找到字体文件夹。详情请参考http://www.aspose.com/docs/display/wordsnet/Considerations+When+Running+on+a+Shared+Server+Environment

    一种解决方法也可以指定文件夹的路径,其中包含所有必需的字体。示例代码请见http://www.aspose.com/docs/display/wordsnet/How+to++Specify+True+Type+Fonts+Location

    如果您仍然遇到问题,请使用输入文档在 Aspose.Words 论坛中报告问题。

    我与 Aspose 合作,担任开发人员传道者。

    【讨论】:

      猜你喜欢
      • 2016-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-14
      • 1970-01-01
      • 2016-03-05
      相关资源
      最近更新 更多