本文介绍了Apache的POI或docx4j处理DOCX文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你觉得哪个更好用读取DOCX文档作为Java对象,为什么?

What do you think Which is better to use to read docx document as java objects and why ?

推荐答案

披露:我带领docx4j项目

虽然docx4j还可以处理PPTX和XLSX,它主要用于DOCX操纵。通过举例的方式,在编写的时候,有在近1000个主题。该PPTX论坛只有10%的体积。

Although docx4j can also handle pptx and xlsx, it is mostly used for docx manipulation. By way of illustration, as at the time of writing, there are nearly 1000 topics in the docx4j forum. The pptx forum has only 10% of the volume.

无论你想用DOCX文档做的,docx4j应该能够帮助你。有一个一个通用的工作流程。

Whatever you want to do with the docx document, docx4j ought to be able to help you. There's a single page overview of a generic workflow.

对于许多共同的要求,docx4j提供了更高级别的API。这些措施包括:

For many common requirements, docx4j provides higher level API. These include:


  • 创建/打开/保存的docx(当然)

  • Create/open/save docx (of course)

报告/文档生成,使用各种办法:(一)可变
替代,(二)XML数据绑定(特别强),及(iii)邮件合并

Report/document generation, using a variety of approaches: (i) Variablesubstitution, (ii) XML data binding (particularly strong), and (iii) Mailmerge

导出为HTML,XHTML

Export as HTML, XHTML

导出为PDF(与字体支持)

Export as PDF (with font support)

为别的,你可以操纵的docx你的心脏的内容的JAXB重新presentation。 JAXB是一个Java社区的标准,包括在Java 6中,并在的EclipseLink的MOXY很强的另一种实现。 (POI使用,而不是JAXB XML豆类)

For anything else, you can manipulate the JAXB representation of the docx to your heart's content. JAXB is a Java community standard, included in Java 6, and with a strong alternative implementation in EclipseLink's MOXy. (POI uses XML Beans instead of JAXB)

有一个来帮助你探索DOCX,并生成Java code创建相应的Java对象。

There's a web app to help you explore a docx, and generate Java code to create corresponding Java objects.

当然,如果你心中有一些特定的任务,它可能是docx4j或兴趣点有一个特别的力量在那里。

Of course, if there is some specific task you have in mind, it may be that docx4j or POI has a particular strength there.

这两个docx4j和POI是行货ASL v2的。

Both docx4j and POI are ASL v2 licensed.

docx4j积极维护;其源$ C ​​$ c是在GitHub上 ,我们再感激。

docx4j does rely on POI as a library for its implementation of the OLE 2 Compound Document format, which we're grateful for.

这篇关于Apache的POI或docx4j处理DOCX文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-28 11:45