Product Family

Add Text Watermark to OTT via Java

Build your own Java apps to watermark Microsoft Word OTT files using server-side APIs.

How to Watermark OTT File Using Java

In order to watermark Micrososft Word OTT file, we’ll use

Aspose.Words for Java

API which is a feature-rich, powerful and easy to use warermarking API for Java platform. You can download its latest version directly from


and install it within your Maven-based project by adding the following configurations to the pom.xml.


<name>Aspose Java API</name>


<version>version of aspose-words API</version>

Steps to Add Watermark to OTT via Java

  1. Load OTT file with an instance of Document
  2. Create an instance of TextWatermarkOptions and set its properties
  3. Call Watermark.setText method and pass watermark text & object of TextWatermarkOptions
  4. Save the document with text watermark

System Requirements

Before integrating the code, make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
  • Get latest version of Aspose.Words for Java directly from Maven.

Add Watermark to OTT - Java

//adding text watermark
Document ott = new Document(dataDir + "Document.ott");

TextWatermarkOptions options = new TextWatermarkOptions();

ott.getWatermark().setText("Test", options);

ott.save(dataDir + "AddTextWatermark_out.ott");

// similarly adding image watermark is with just few lines of code  
  • Java Words API can be used to load, view and convert Microsoft Word and OpenDocument Formats like DOC, DOCX, ODT to PDF, XPS, HTML and various other formats. You can also create new documents from scratch and save them in the supported formats. It is a standalone API that is suitable for server side and backend systems where high performance is required. It does not depend on any software like Microsoft or OpenOffice. ‎

    Watermark OTT via Online App

    Other Supported Watermarking Formats

    Using Java, one can easily watermark different formats including.

    DOC (Microsoft Word Binary Format)
    DOCX (Office 2007+ Words Document)
    DOT (Microsoft Word Template Files)
    DOTX (Microsoft Word Template File)
    ODT (OpenDocument Text File Format)
    RTF (Rich Text Format)