与 OpenOffice Writer 的远程互操作

发布于 2024-09-11 09:54:54 字数 561 浏览 3 评论 0原文

我找到了一些有关使用 COM 等技术与 OpenOffice 进行互操作的文档,但在更深入地研究之前,我想知道是否有人从事过此类工作?

我们需要以下内容,全部包含在来自客户端 PC 的方法调用中(客户端使用 COM 与服务器对话):

  1. 客户端将名称/值对的映射发送到服务器应用程序
  2. 服务器打开一个 Word 模板(当前为 .dot ) 文件并使用 1 中的名称查找书签,用值替换文本
  3. 服务器将文件另存为 Word .doc 文件

我们使用 Word 执行此操作,但 Windows 2008 中的一些更改意味着如果您在没有桌面/交互式用户、Word 的情况下运行不会启动。这显然是一个很大的黑客攻击,但我们正在寻找一个快速的解决方案,而不是由于时间限制而重新设计......所以我想知道我们是否可以简单地在服务器上运行 OO Writer 来完成相同的工作?我知道这一切有多么丑陋,所以不需要建议来创建全新的 C# 开放 XML SDK 应用程序。

可以将多个同时请求作为潜在问题排除(或者至少使用 Word 从来都不是问题,因此除非 OO 不同,否则它将被忽略)。

I found some documentation about interop with OpenOffice using technologies like COM, but before delving in more deeply I wondered if anyone's worked on this kind of thing?

We have a need for the following, all wrapped up in a method call from a client PC (client talks to server using COM):

  1. Client sends a map of name/value pairs to a server app
  2. Server opens a Word template (.dot currently) file and looking up bookmarks using names from 1, replaces the text with values
  3. Server saves file as a Word .doc file

We were doing this using Word but some changes in Windows 2008 mean if you run without a desktop/interactive-user, Word won't start. It's obviously a big hack but we're looking for a quick solution rather than re-engineering due to time constraints... so I wondered if we can simply run up OO Writer on the server to do the same job? I know how ugly it all is so don't really need suggestions to create a brand new C# open XML SDK application.

Multiple simultaneous requests can be ruled out as a potential problem (or at least it's never been a problem using Word so unless OO is different it'll be ignored).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

〃安静 2024-09-18 09:54:54

如果您认为 OpenOffice 可能有帮助,您可以使用 JODReports 或 Docmosis 来提供帮助,尽管您需要一个小型 Java 程序来桥接 C++ 应用程序(命令行或其他)。与直接使用 OO API 相比,这些工具可以让您更轻松地控制 OpenOffice 来执行合并任务(希望学习曲线较低)。

If you are thinking OpenOffice might help, you could use JODReports or Docmosis to help, though you'd need a small Java program to bridge from your C++ app (cmd line or whatever). These tools will let you control OpenOffice a little easier for doing your merge task than working with the OO API directly (hopefully a lower learning curve).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文