Add watermarks to PowerPoint presentations
Leave feedback
On this page
Open a presentation with PresentationLoadOptions and pass a presentation-specific watermark option to add() to target a particular slide.
Use PresentationWatermarkSlideOptions and set slide_index (0-based) to add the watermark to a specific slide.
from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import TextWatermark, Font, Color
from groupdocs.watermark.common import HorizontalAlignment, VerticalAlignment
from groupdocs.watermark.options.presentation import (
PresentationLoadOptions, PresentationWatermarkSlideOptions,
)
def add_watermark_to_slide():
with Watermarker("./presentation.pptx", PresentationLoadOptions()) as watermarker:
watermark = TextWatermark("CONFIDENTIAL", Font("Arial", 19.0))
watermark.foreground_color = Color.red
watermark.horizontal_alignment = HorizontalAlignment.CENTER
watermark.vertical_alignment = VerticalAlignment.CENTER
options = PresentationWatermarkSlideOptions()
options.slide_index = 0
watermarker.add(watermark, options)
watermarker.save("./output.pptx")
if __name__ == "__main__":
add_watermark_to_slide()
presentation.pptx is the sample file used in this example. Click here to download it.
Binary file (PPTX, 241 KB)
You can also add watermarks to master, layout, and notes slides with PresentationWatermarkMasterSlideOptions, PresentationWatermarkLayoutSlideOptions, and PresentationWatermarkNoteSlideOptions. Watermarker.get_content() returns a PresentationContent exposing each slide and its background.
For working with slide backgrounds and charts, see Working with slide backgrounds.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.