Skip to content

Instantly share code, notes, and snippets.

@aspose-com-kb
Last active January 6, 2024 13:25
Remove Watermark in PowerPoint using C#. For more details: https://kb.aspose.com/slides/net/remove-watermark-in-powerpoint-using-csharp/
using System;
using Aspose.Slides;
using Aspose.Slides.Export;
class Program
{
static void Main(string[] args) // Remove watermark in slide using C#
{
new Aspose.Slides.License().SetLicense("License.lic");
Presentation pres = new Presentation("WithWatermark.pptx");
foreach (var slide in pres.Slides)
{
for (int i = 0; i < slide.Shapes.Count; i++)
{
AutoShape shape = (AutoShape)slide.Shapes[i];
if(shape.Name == "watermark")
{
slide.Shapes.Remove(shape);
}
}
}
pres.Save("WithoutWatermark.pptx", SaveFormat.Pptx);
Console.WriteLine("Done");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment