Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Search Watermarks from Documents in .NET
// Find all the watermarks in Word, Excel, PowerPoint, Visio and PDF Documents using C#
using (Watermarker watermarker = new Watermarker("filepath/documentWithWatermarks.pdf"))
{
PossibleWatermarkCollection possibleWatermarks = watermarker.Search();
foreach (PossibleWatermark possibleWatermark in possibleWatermarks)
{
if (possibleWatermark.ImageData != null)
{
Console.WriteLine(possibleWatermark.ImageData.Length);
}
Console.WriteLine(possibleWatermark.Text);
Console.WriteLine(possibleWatermark.X);
Console.WriteLine(possibleWatermark.Y);
Console.WriteLine(possibleWatermark.RotateAngle);
Console.WriteLine(possibleWatermark.Width);
Console.WriteLine(possibleWatermark.Height);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.