In this step by step tutorial, we’ll elaborate how to insert draft watermark in PowerPoint Presentation in C# without PowerPoint installed. The PPTX format is widely used format for PowerPoint presentations now a days, but this example is also applicable to legacy PPT for adding confidential watermark PowerPoint.
Steps to add confidential watermark to PowerPoint in C#
- Get Aspose.Slides for .NET package from NuGet.org
- Use Aspose.Slides namespace to load presentation and insert watermark
- Set license using SetLicense method
- Load the PowerPoint presentation to insert watermark in Presentation Class object
- Access and iterate through Master Slide/s inside presentation
- For each master slide, add an Autoshape
- Insert confidential draft text for the added shape TextFrame
- Format the shape and textual properties
- Apply locking on the added shape to protect watermark
- Save watermarked presentation
Previously, we looked into How to Secure PowerPoint Presentation in C# .NET in another how-to topic. But this topic describe the steps to add confidential watermark in powerpoint in C#. You are not dependent on Microsoft PowerPoint or Interop to use this feature and can run this code seamlessly on all platforms.
On top of every thing, the shape locking feature is a unique feature offered by Aspose.Slides which is not even available in PowerPoint publicly. You can safeguard the intellectual property rights of the presentation by using locking feature and applying that to watermark shape and disallowing any one modifying or removing it in PowerPoint.
Code to Add Draft Watermark in PowerPoint in C# without Interop
The example can be used in any .NET application environment using the C# code, whether it’s an ASP.NET web application, Windows Forms application, or Console based. You can also use it on your local work machine or on any server having .NET Framework installed.