将 MS Word 文档转换为 XPS 文档的 .NET 库
有谁知道可以将 Microsoft Word 文档转换为 XPS 文件的第 3 方库?
我知道使用 MS Word 或使用 Word 自动化可以实现这一点,但我希望有一个库来进行转换,而不依赖于计算机安装 MS Word。
我需要使用 API 在代码中完全进行转换。转换过程中不会有用户交互。
谢谢, 克里斯.
Does anyone know of a 3rd party library that will convert a Microsoft Word document to an XPS file?
I know this is possible using MS Word or using Word automation, but I would like to have a library to do the converting that does not rely on the computer to have MS Word installed.
I need to do the converting completely in code using an API. There will be no user interaction in the converting process.
Thanks,
Chris.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Office Interop 直接进行转换,无需任何第 3 方 dll。这里有一篇文章演示了如何使用 WPF 以 XPS 形式查看 Word 文档(文章链接现已失效并已被删除)。
从本文中提供的代码来看,将 Word 转换为 XPS 应该相当简单;当然,忽略 WPF 部分。
编辑
以上答案确实需要Word;我的错误。
Apose.Word for .NET 将在不安装 Office/Word 的情况下将 Word 转换为 XPS。虽然它可能有点贵。
You may be able to do the conversion directly without any 3rd party dll's using Office Interop. Here's an article demonstrating how to view a Word doc as an XPS using WPF (link to article is now dead and has been removed).
From the code presented in the article, converting Word to XPS should be fairly straight forward; ignoring the WPF parts, of course.
EDIT
The above answer does require Word; my mistake.
Apose.Word for .NET will convert Word to XPS without Office/Word installed. Though it's probably a bit pricey.