使用java以编程方式保护word文档

问题描述:

我正在使用 java 代码从模板 XML 文档创建一个 word 2003 文档.我需要在文档创建后对其进行保护(设为只读).文档中有一些字段是可编辑的(即开发者模式的文本表单字段),在创建文档后可以进行编辑.这个可以用java来实现吗?

I am creating a word 2003 document from a template XML document using a java code. I need to protect (make read-only) the document after it has been created. The document has some fields as editable (i.e. text form fields of the developer mode) in it, which can be editable after the document is created. Can this be achieved using java?

看看 Apache poi.这是一个处理office文档的java库.

Have a look at Apache poi. This is a java library for manipulating office document.