public final class WordProcessingWatermarkPagesOptions extends WordProcessingWatermarkBaseOptions
Learn more:
The following example demonstrates how to add a watermark to a particular page of a Word document.
WordProcessingLoadOptions loadOptions = new WordProcessingLoadOptions(); Watermarker watermarker = new Watermarker("D:\\test.doc", loadOptions); TextWatermark watermark = new TextWatermark("Test", new Font("Arial", 14)); WordProcessingWatermarkPagesOptions options = new WordProcessingWatermarkPagesOptions(); options.setPageNumbers(new int[] { 1 }); watermarker.save("D:\\watermarked_test.doc"); watermarker.close();
Constructor and Description |
---|
WordProcessingWatermarkPagesOptions()
Initializes a new instance of the
class. |
Modifier and Type | Method and Description |
---|---|
int[] |
getPageNumbers()
Gets the page numbers to add the watermark.
|
void |
setPageNumbers(int[] value)
Sets the page numbers to add the watermark.
|
getAlternativeText, getEffects, getLockType, getName, getPassword, isLocked, setAlternativeText, setEffects, setLocked, setLockType, setName, setPassword
public WordProcessingWatermarkPagesOptions()
WordProcessingWatermarkPagesOptions
class.public final int[] getPageNumbers()
Gets the page numbers to add the watermark.
null
or empty, the watermark is added to all pages.
public final void setPageNumbers(int[] value)
Sets the page numbers to add the watermark.
value
- The page numbers to add the watermark.null
or empty, the watermark is added to all pages.