usmanazizgroupdocs
4/17/2017 - 10:15 AM

AddAnnotationWatermark.cs

// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (PdfDocument doc = Document.Load<PdfDocument>(Utilities.MapSourceFilePath (FilePath)))
{
    // Add text watermark
    TextWatermark textWatermark = new TextWatermark("This is a test watermark", new Font("Arial", 8));
    doc.AddAnnotationWatermark(textWatermark);

    // Add image watermark
    using (ImageWatermark imageWatermark = new ImageWatermark(@"D:\protect.jpg"))
    {
        doc.AddAnnotationWatermark(imageWatermark);
    }
    doc.Save();
}