com.groupdocs.watermark.options

Interfaces

Classes

com.groupdocs.watermark.options

Class WordProcessingWatermarkPagesOptions



  • 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();
     
    • Method Detail

      • getPageNumbers

        public final int[] getPageNumbers()

        Gets the page numbers to add the watermark.

        Returns:
        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

        public final void setPageNumbers(int[] value)

        Sets the page numbers to add the watermark.

        Parameters:
        value - 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.