Watermarker.get_content() returns a PresentationContent whose slides each expose an image_fill_format with a background_image, tile_as_texture, and transparency. The background image is None when the slide has no image fill.
Extract information about slide backgrounds
fromgroupdocs.watermarkimportWatermarkerfromgroupdocs.watermark.options.presentationimportPresentationLoadOptionsdefextract_slide_backgrounds():withWatermarker("./presentation.pptx",PresentationLoadOptions())aswatermarker:content=watermarker.get_content()fori,slideinenumerate(content.slides):background=slide.image_fill_format.background_imageifbackgroundisnotNone:print(f"Slide {i}: background {background.width}x{background.height}")else:print(f"Slide {i}: no background image")if__name__=="__main__":extract_slide_backgrounds()
presentation.pptx is the sample file used in this example. Click here to download it.
Slide 0: background 1600x1000
Slide 1: no background image
Slide 2: background 640x400
Slide 3: no background image
Slide 4: no background image
You can also tune image_fill_format.transparency (0.0–1.0) and image_fill_format.tile_as_texture when setting a background image. The same image_fill_format is available on chart objects.
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.
On this page
Ask AI
Ask anything about this page — the answer is based on its content.
Searching the docs and writing an answer…
Something went wrong while getting an answer. Please try again in a moment.