In this simple and elaborative tutorial, we will focus on, how to add image watermark in PPTX using Python without PowerPoint being installed. This application can be used to add PowerPoint watermark background image using Python in any of the .NET Core and Python configured environments inside macOS, Windows or Linux.
Steps to add image watermark to PPTX presentation in Python
- Establish the environment to install Aspose.Slides for Python via .NET for inserting an image watermark inside the presentation
- Access an existing or create a new presentation to add a watermark image using the Presentation class object
- Insert the desired watermark image inside the presentation image collection
- Traverse through each shape inside the the presentation Master Slide/s collection
- Insert a picture frame shape with the desired image for every slide inside the master slides collection
- Apply the locking on the shapes to secure the image watermark
- Save the presentation with the image watermark on the disk
The above steps in Python add picture watermark in PPT using a very simple API interface and a few lines of code. The process is initiated by either loading an existing presentation or creating a new one along with the loading of the desired watermark image from the disk. Then each slide inside the presentation master slide collections is iterated and a picture frame using the watermark image is created. Finally, different locks are applied to each shape to protect them from accessing or editing.
Code to add Image Watermark in PPTX using Python
In order to add watermark image in PPT Python based API has been effectively used in the above example. The shape_lock class has been used, that offers different shape locks including lock selection, resizing and changing the position to prevent any access to the shape even in PowerPoint.
In this topic, we have learnt to put a watermark image in PPTX using Python and embed intellectual property rights inside the presentation. If you are interested in adding a text based watermark inside the presentation, refer to the article on how to insert Draft Watermark in PPTX using Python.