GroupDocsGists
10/19/2017 - 11:05 AM

AddWatermarkUsingCellsShapeSettings.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("Test watermark", new Font("Segoe UI", 19));
    CellsShapeSettings shapeSettings = new CellsShapeSettings();

    // Set the shape name
    shapeSettings.Name = "Shape 1";

    // Set the descriptive (alternative) text that will be associated with the shape
    shapeSettings.AlternativeText = "Test watermark";

    // Editing of the shape in Excel is forbidden
    shapeSettings.IsLocked = true;

    doc.AddWatermark(watermark, shapeSettings);


    doc.Save();
}