ImageWatermarkOptions Class
Contains watermark options.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v21.1.Core.dll
NuGet Package: DevExpress.RichEdit.Core
Declaration
Example
The code sample below adds an image watermark:
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