Package org.docx4j.samples
Class CreateDocxProtected
java.lang.Object
org.docx4j.samples.AbstractSample
org.docx4j.samples.CreateDocxProtected
Protect document against editing in Word.
Note: encyption, signing are different concepts. For encryption, use Docx4J.save
with Docx4J.FLAG_SAVE_ENCRYPTED_AGILE. For signing, you need the Enterprise edition.
WARNING: this doc protect functionality may give a false sense of security, since it only affects
the behaviour of Word's user interface. A mischevious user could still edit the document
in some other program, and subsequent users would *not* be warned it has been tampered with.
So if you protect the document against editing, you should also sign it. A signature will warn
if the docx has been tampered with (unless the signature is removed entirely, which is easy enough).
(Encrypting the docx when you
save it doesn't help much in this scenario, since you have to share the password with viewers - there
are no separate passwords for viewing versus editing).
- Since:
- 3.3.0
-
Field Summary
Fields inherited from class org.docx4j.samples.AbstractSample
inputfilepath, outputfilepath -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.docx4j.samples.AbstractSample
getInputFilePath, getOutputFilePath
-
Constructor Details
-
CreateDocxProtected
public CreateDocxProtected()
-
-
Method Details
-
main
- Throws:
Exception
-