【发布时间】:2017-02-13 13:07:39
【问题描述】:
我们如何将 excel 文件和 word 文件从 c# 转换为 .pdf 格式。我尝试了以下代码,但它显示错误
这是我的代码:
Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application();
wordDocument = appWord.Documents.Open(@"C:\Users\ITPro2\Documents\test.docx");
wordDocument.ExportAsFixedFormat(@"D:\desktop\DocTo.pdf", Microsoft.Office.Interop.Word.WdExportFormat.wdExportFormatPDF);
我得到了以下错误
The export failed because this feature is not installed. 在从 c# 中的 word 导出到 pdf 期间
【问题讨论】:
-
我可以知道您使用的是哪个版本的
Interop对象吗? -
是所有必要的C#标签
-
最好使用 Aspose 或开源 pdf-printer API
-
@balagurunath 上午 14 点使用
-
@lzzy 。我不明白