public class WordProcessingContent extends Content
Learn more:
The following example demonstrates how to load and save Word document of any supported type.
WordProcessingLoadOptions loadOptions = new WordProcessingLoadOptions(); Watermarker watermarker = new Watermarker("D:\\input.doc", loadOptions); // Use add method to add watermark to a particular or all sections. // Save changes. watermarker.save("D:\\output.doc"); watermarker.close();
Modifier and Type | Method and Description |
---|---|
void |
decrypt()
Decrypts the document.
|
void |
encrypt(String password)
Encrypts the document.
|
int |
getPageCount()
Gets the number of pages in the document.
|
WordProcessingSectionCollection |
getSections()
Gets the collection of all sections of this
. |
void |
protect(int protectionType,
String password)
Protects the document from changes and sets a protection password.
|
void |
unprotect()
Removes protection from the document regardless of the password.
|
findImages, findImages, search, search
public final WordProcessingSectionCollection getSections()
WordProcessingContent
.WordProcessingContent
.public final int getPageCount()
Gets the number of pages in the document.
public final void encrypt(String password)
Encrypts the document.
password
- The password that will be required to open the document.public final void decrypt()
Decrypts the document.
public final void protect(int protectionType, String password)
To have the content of the document editable use appropriate method of adding watermark with
or
WordProcessingLockType.AllowOnlyFormFields
parameter.WordProcessingLockType.ReadOnlyWithEditableContent
protectionType
- The protection type for the document.password
- The password to protect the document with.public final void unprotect()
Removes protection from the document regardless of the password.