如何以编程方式从 Office 文件中提取和操作图像?

发布于 2024-08-14 04:58:15 字数 70 浏览 2 评论 0原文

如何从 PowerPoint 和 Word 文档中提取一些图像,以便对其进行操作,然后将图像放回 MS Office 文件中?

How to extract some images from PowerPoint and Word documents, in order to manipulate them, and after that, put the images back in the MS Office files?

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

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

发布评论

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

评论(4

西瓜 2024-08-21 04:58:15

Apache 有一个名为“POI”的项目,专门用于与 Java 中的 MS Office 格式进行交互。希望这对你有用!

http://poi.apache.org/

Apache has a project called "POI" explicitly made for interacting with MS Office formats from Java. Hopefully that does it for you!

http://poi.apache.org/

北恋 2024-08-21 04:58:15

Apache POI 可以通过其 HWPF 模块,并从中提取或插入图像。尽管没有详细记录,但请查看 用于在 Word 中进行图像处理的 POI 单元测试单元测试似乎是该模块的最佳文档)。

否则,可以通过(例如)JACOB 访问 COM 接口。这可能需要更多工作,但会提供不通过 POI 公开的可用 API。

Apache POI can handle Word documents via its HWPF module, and extract or insert images from these. Although it's not well documented, check out the POI unit tests for image manipulation within Word (the unit tests seem to be the best documentation for this module).

Failing that, the COM interface is accessible via (say) JACOB. That's probably more work, but will make available APIs not exposed via POI.

究竟谁懂我的在乎 2024-08-21 04:58:15

就C++而言,Word公开了COM API以允许您操作其文档格式,因此只要您的计算机上安装了Word,您就可以在C++中非常轻松地执行此操作。 Word 不是开源的,但您可能已经拥有许可证。

In terms of C++, Word exposes a COM API to allow you to manipulate its document format, so as long as you have Word installed on the machine, you can do this in C++ quite easily. Word isn't open source, but you probably have the license anyway.

滥情哥ㄟ 2024-08-21 04:58:15

我工作的公司 SoftArtisans 有一款名为 OfficeWriter 的产品,除其他外,它还允许您执行以下操作:适用于 Word 和 Excel(计划将来添加 PowerPoint)。但它不是免费或开源的。

另一方面,如果您严格使用 2007 格式(基于 XML),您可能可以使用 OpenXML

The company I work for, SoftArtisans, has a product called OfficeWriter that allows you do that, among other things, for Word and Excel (PowerPoint is planned to be added in the future). It is not free or open sourced though.

On the other hand, if you are working strictly with 2007 format (XML based) you can probably use OpenXML.

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