usmanazizgroupdocs
4/17/2017 - 10:13 AM

AddTextWatermarkIntoHeaderFooter.cs

// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (CellsDocument doc = Document.Load<CellsDocument>(Utilities.MapSourceFilePath (FilePath)))
{
    TextWatermark watermark = new TextWatermark(WatermarkText, new Font("Segoe UI", 19, FontStyle.Bold));
    watermark.ForegroundColor = Color.Red;
    watermark.BackgroundColor = Color.Aqua;
    watermark.VerticalAlignment = VerticalAlignment.Top;
    watermark.HorizontalAlignment = HorizontalAlignment.Center;
    doc.Worksheets[0].AddWatermarkIntoHeaderFooter(watermark);
    doc.Save();
}