apache 如何使用java创建.doc文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1222951/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 18:01:23  来源:igfitidea点击:

how to create .doc file using java?

javaapacheduplicatesapache-poi.doc

提问by mykola

Can anyone tell me how to create doc files using java? I know, there's a POI library, but it seems like it can save only simple documents. You can read anything you wish, but you can't save it all back again. Or may be i missed something? How can i save whole document with pictures, tables and styles?

谁能告诉我如何使用java创建doc文件?我知道,有一个 POI 库,但它似乎只能保存简单的文档。您可以阅读任何您想要的内容,但您无法将其全部保存回来。或者我可能错过了什么?如何保存包含图片、表格和样式的整个文档?

回答by Paul Jowett

Docmosislets you do heaps of styling easily via the template. Uses OpenOffice and Java to do the job. Its free and free to distribute.

Docmosis可让您通过模板轻松地进行大量样式设置。使用 OpenOffice 和 Java 来完成这项工作。它免费且免费分发。

回答by German Attanasio

OpenOffice.org's Universal Network Objects (UNO), allow you to generate .doc,.PDF, as well as OpenOffice documents. It supports several programming languages like: Java, C++, Visual Basic, etcc..

OpenOffice.org 的通用网络对象 (UNO) 允许您生成.doc、.PDF 以及 OpenOffice 文档。它支持多种编程语言,如:Java、C++、Visual Basic 等。

Some good things is that: its free, open source and plataform-independent

一些好处是:它免费、开源且独立于平台

You can build documents, spreadsheets, presentations, etc. Start from scratch or using a template and fill the gaps..

您可以构建文档、电子表格、演示文稿等。从头开始或使用模板并填补空白。

In order to use it you will need to include some libraries that comes with the OpenOffice suite.

为了使用它,您需要包含 OpenOffice 套件附带的一些库。

Useful links:

有用的链接:

回答by banjollity

It ain't cheap, but you could try Aspose.Words. It'll do everything you state above and more.

它并不便宜,但你可以试试Aspose.Words。它会完成你上面所说的一切,甚至更多。

回答by nairdaen

JODConverterwill allow you to convert lots of different document formats

JODConverter将允许您转换许多不同的文档格式