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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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