如何创建使用Apache POI的Word文档?

问题描述:

如何使用Apache POI创建一个Word文档?

How to create a Word Document using Apache POI?

我开发Atlassian的合流简历编辑器作为商业插件。

I am developing a Resume Editor for Atlassian Confluence as Commercial Plugin.

我很抱歉,我不得不问这个,但我没有找到教程女巫能帮助我。

I am sorry I had to ask this but I do not find tutorials witch can help me.

您连接code文件DownloadAsMicrosoftWordDocument.java.txt有文件下载功能的编码;没有Word文档的创建。

Your attached code file "DownloadAsMicrosoftWordDocument.java.txt" has a coding for file download functionality; no Word document creation.

当你寻找Word文档的创建,请看看下面的参考资料:

As you looking for Word Document creation, please find references below:

HWPF参考(.DOC): POI躯干没有实例为XWPF做,但是POI暂存器测试用例周围,请找

HWPF Reference(.doc): POI trunk doesn't have examples as XWPF do, However POI Scratchpad has Testcases around it, please find

  • POI Scratchpad
  • Javadoc HWPFDocument
  • Javadoc org.apache.poi.hwpf.usermodel

XWPF参考文件(.docx):来自Apache POI SVN回购的例子

XWPF Reference(.docx): Examples from Apache POI SVN Repo

  • SimpleDocument.java
  • SimpleImages.java
  • SimpleTable.java
  • UpdateEmbeddedDoc.java

请参考以下链接:

写作的Microsoft Word文档在Java中与Apache POI(第1部分 - 写段)

使用Java语言编写的Microsoft Word文档与Apache POI(第2部分 - 创建表)

和还提到POI 的Javadoc 对于XWPF(Word文档)。

And also refer POI Javadocs for XWPF (Word Document).

我希望它会为你提供启动!

I hope it will provide startup for you!