How to programmatically extract and manipulate ima

2019-07-05 05:38发布

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?

4条回答
Deceive 欺骗
2楼-- · 2019-07-05 05:55

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/

查看更多
女痞
3楼-- · 2019-07-05 05:58

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.

查看更多
Lonely孤独者°
4楼-- · 2019-07-05 05:59

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.

查看更多
一夜七次
5楼-- · 2019-07-05 06:18

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.

查看更多
登录 后发表回答