Aspose.Words  for C++

Add Text Watermark to DOCX via C++

Build your own C++ apps to watermark DOCX files using server-side APIs.

How to Watermark DOCX File Using C++

In order to watermark DOCX file, we’ll use

Aspose.Words for C++

API which is a feature-rich, powerful and easy to use document watermarking API for C++ platform. You can download its latest version directly, just open


package manager, search for Aspose.Words.Cpp and install. You may also use the following command from the Package Manager Console.


PM> Install-Package Aspose.Words.Cpp

Steps to Add Watermark to DOCX via C++

You need the


to try the following workflow in your own environment.

  1. Load DOCX files with an instance of Document
  2. Set different properties for text watermark
  3. Call SetText method and pass watermark text & object of TextWatermarkOptions
  4. Save the document

System Requirements

Aspose.Words for C++ supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with C++ Runtime Environment for Windows 32 bit, Windows 64 bit and Linux 64 bit.
  • Aspose.Words for C++ DLL referenced in your project.

Add Watermark to DOCX - C++

// Load input docx document
auto docx = System::MakeObject<Document>(inputDataDir + u"Document.docx");

// Set different properties for text watermark
auto options = System::MakeObject<TextWatermarkOptions>();

// Set text for the watermark
docx->get_Watermark()->SetText(u"Test", options);

auto outputPath = outputDataDir + u"AddTextWatermark.docx";

  • About Aspose.Words for C++ API

    Aspose.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. Aspose.Words 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 DOCX via Online App

    Other Supported Watermarking Formats

    Using C++, one can easily watermark different formats including.

    DOC (Microsoft Word Binary Format)
    DOT (Microsoft Word Template Files)
    DOTX (Microsoft Word Template File)
    ODT (OpenDocument Text File Format)
    OTT (OpenDocument Standard Format)
    RTF (Rich Text Format)