Skip to main content
A newer version of this page is available. .
All docs
V21.1
.NET Framework 4.5.2+

ImageWatermarkOptions Class

Contains watermark options.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v21.1.Core.dll

NuGet Package: DevExpress.RichEdit.Core

Declaration

public class ImageWatermarkOptions

Example

The code sample below adds an image watermark:

result

using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
    wordProcessor.LoadDocument("DocumentProtection.docx");

    // Check whether the document sections have headers:
    foreach (Section section in wordProcessor.Document.Sections)
    {
        if (!section.HasHeader(HeaderFooterType.Primary))
        {
            // If not, create an empty header
            SubDocument header = section.BeginUpdateHeader();
            section.EndUpdateHeader(header);
        }
    }

    ImageWatermarkOptions imageWatermarkOptions = new ImageWatermarkOptions();
    imageWatermarkOptions.Washout = false;
    imageWatermarkOptions.Scale = 1.5;
    wordProcessor.Document.WatermarkManager.SetImage(Image.FromFile("DevExpress.png"), imageWatermarkOptions);
    wordProcessor.SaveDocument("DocumentProtection_new.docx", DocumentFormat.OpenXml);
}

Inheritance

Object
ImageWatermarkOptions
See Also