PPTX
DOCX
XLSX
PDF
ODP
DOT
Add Text Watermark to DOT via C++
Build your own C++ apps to watermark DOT files using server-side APIs.
How to Watermark DOT File Using C++
In order to watermark DOT file, we’ll use
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.
Command
PM> Install-Package Aspose.Words.Cpp
Steps to Add Watermark to DOT via C++
You need the
to try the following workflow in your own environment.
- Load DOT files with an instance of Document
- Set different properties for text watermark
- Call SetText method and pass watermark text & object of TextWatermarkOptions
- 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 DOT - C++
// Load input dot document
auto dot = System::MakeObject<Document>(inputDataDir + u"Document.dot");
// Set different properties for text watermark
auto options = System::MakeObject<TextWatermarkOptions>();
options->set_FontFamily(u"Arial");
options->set_FontSize(36);
options->set_Color(System::Drawing::Color::get_Black());
options->set_Layout(WatermarkLayout::Horizontal);
options->set_IsSemitrasparent(false);
// Set text for the watermark
dot->get_Watermark()->SetText(u"Test", options);
auto outputPath = outputDataDir + u"AddTextWatermark.dot";
dot->Save(outputPath);