GroupDocs.Watermark API provides the ability to add watermarks to document, where each added watermark being associated with a unique GUID (Globally Unique Identifier). This functionality not only enhances the security of the watermarked content, but also introduces a range of practical applications, like ability to trace the origin and distribution path of the watermarks, searching and removing specific watermark by id.
Reviewing the result of added watermarks
The following code snippet shows how to review result AddWatermarkResult with information about added watermarks in the document.
using(Watermarkerwatermarker=newWatermarker("sample_2_pages.pdf")){// Initialize the font to be used for watermarkFontfont=newFont("Arial",19,FontStyle.Bold|FontStyle.Italic);// Create the watermark objectTextWatermarkwatermark=newTextWatermark("Test watermark",font);// Set watermark propertieswatermark.ForegroundColor=Color.Red;watermark.BackgroundColor=Color.Blue;watermark.TextAlignment=TextAlignment.Right;watermark.Opacity=0.5;// Add watermarkvarresult=watermarker.Add(watermark);foreach(variteminresult.Succeeded){Console.WriteLine("WatermarkId: {0}",item.WatermarkId);Console.WriteLine("WatermarkType: {0}",item.WatermarkType);Console.WriteLine("PageNumber: {0}",item.PageNumber);Console.WriteLine("WatermarkPosition: {0}",item.WatermarkPosition);}watermarker.Save(outputFileName);}