WordProcessingWatermarkPagesOptions

Inheritance: java.lang.Object, com.groupdocs.watermark.options.WatermarkOptions, com.groupdocs.watermark.options.WordProcessingWatermarkOptions, com.groupdocs.watermark.options.WordProcessingWatermarkBaseOptions

public final class WordProcessingWatermarkPagesOptions extends WordProcessingWatermarkBaseOptions

Represents options when adding watermark to Word document pages.

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();

Constructors

Constructor Description
WordProcessingWatermarkPagesOptions() Initializes a new instance of the [WordProcessingWatermarkPagesOptions](../../com.groupdocs.watermark.options/wordprocessingwatermarkpagesoptions) class.

Methods

Method Description
getPageNumbers() Gets the page numbers to add the watermark.
setPageNumbers(int[] value) Sets the page numbers to add the watermark.

WordProcessingWatermarkPagesOptions()

public WordProcessingWatermarkPagesOptions()

Initializes a new instance of the [WordProcessingWatermarkPagesOptions](../../com.groupdocs.watermark.options/wordprocessingwatermarkpagesoptions) class.

getPageNumbers()

public final int[] getPageNumbers()

Gets the page numbers to add the watermark.

Returns: int[] - The page numbers to add the watermark.


All numbers must be greater than or equal to 1. This property is only used when adding the watermark to a document. If this value is null or empty, the watermark is added to all pages.

setPageNumbers(int[] value)

public final void setPageNumbers(int[] value)

Sets the page numbers to add the watermark.

Parameters:

Parameter Type Description
value int[] The page numbers to add the watermark.

All numbers must be greater than or equal to 1. This property is only used when adding the watermark to a document. If this value is null or empty, the watermark is added to all pages. |