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: no background image
Slide 1: no background image
Slide 2: no background image
Slide 3: 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
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.