Add Watermark to ODP Presentation using C++
Use Aspose.Slides for C++ to add text or image watermarks to presentation files without Microsoft PowerPoint.
Add Watermark to ODP Presentation via C++
Aspose.Slides for C++ lets you add text or image watermarks to ODP presentations. Add a watermark shape to the master slide with AddAutoShape, add text with AddTextFrame, or fill the shape with an image loaded through File::ReadAllBytes and AddImage.
Add Text Watermark to ODP using C++
auto presentation = MakeObject<Presentation>(u"presentation.odp");
auto masterSlide = presentation->get_Master(0);
auto watermarkShape = masterSlide->get_Shapes()->AddAutoShape(ShapeType::Rectangle, 100, 100, 400, 80);
watermarkShape->AddTextFrame(u"Watermark");
presentation->Save(u"watermarked-presentation.odp", SaveFormat::Odp);
presentation->Dispose();Add Image Watermark to ODP Presentation using C++
auto presentation = MakeObject<Presentation>(u"presentation.odp");
auto masterSlide = presentation->get_Master(0);
auto watermarkShape = masterSlide->get_Shapes()->AddAutoShape(ShapeType::Rectangle, 100, 100, 400, 200);
auto imageData = File::ReadAllBytes(u"watermark.png");
auto watermarkImage = presentation->get_Images()->AddImage(imageData);
watermarkShape->get_FillFormat()->set_FillType(FillType::Picture);
watermarkShape->get_FillFormat()->get_PictureFillFormat()->get_Picture()->set_Image(watermarkImage);
watermarkShape->get_FillFormat()->get_PictureFillFormat()->set_PictureFillMode(PictureFillMode::Stretch);
presentation->Save(u"image-watermarked-presentation.odp", SaveFormat::Odp);
presentation->Dispose();How to Add Watermark to ODP via C++
Follow these steps to add a text or image watermark to ODP files.
- Load the ODP file with the
Presentationclass. - Select the master slide from the
Presentation::get_Masterscollection. - Add a watermark shape with the
AddAutoShapemethod. - Add watermark text with the
AddTextFramemethod or set a picture fill withAddImage. - Save the watermarked file with
SaveFormat::Odp.
Built with Aspose.Slides
Add Watermarks to ODP Online
The free Aspose.Slides Watermark app is built with Aspose.Slides for C++, the same API as the code above. Open it and see what the API can do with your own ODP files.
- Runs in your browser, nothing to install.
- See how Aspose.Slides adds watermarks before you write code.
- Add a text or image watermark to your ODP file.
- Download the watermarked file.
Other Supported Watermark Formats
Using C++, you can also add watermarks to the following formats.