WordWatermark
OfficeIMO.Word
Represents a watermark element within a Word document.
Inheritance
- WordElement
- WordWatermark
Usage
Explore 7 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 7
- Property WordDocument.Watermarks
- Property WordFooter.Watermarks
- Method WordHeader.AddWatermark
- Property WordHeader.Watermarks
- Property WordHeaderFooter.Watermarks
- Method WordSection.AddWatermark
- Property WordSection.Watermarks
Constructors
public WordWatermark(WordDocument wordDocument, WordSection wordSection, WordWatermarkStyle style, string textOrFilePath, OfficeLength? horizontalOffset = null, OfficeLength? verticalOffset = null, double scale = 1) #Initializes a new instance of the WordWatermark class for the specified section.
Parameters
- wordDocument OfficeIMO.Word.WordDocument
- The parent document.
- wordSection OfficeIMO.Word.WordSection
- The section to which the watermark should be added.
- style OfficeIMO.Word.WordWatermarkStyle
- The type of watermark to add.
- textOrFilePath string
- Text to use or path to the watermark image.
- horizontalOffset OfficeIMO.OfficeLength? = null
- Optional signed horizontal offset.
- verticalOffset OfficeIMO.OfficeLength? = null
- Optional signed vertical offset.
- scale double = 1
- Scale factor for width and height.
public WordWatermark(WordDocument wordDocument, WordSection wordSection, WordHeader wordHeader, WordWatermarkStyle style, string textOrFilePath, OfficeLength? horizontalOffset = null, OfficeLength? verticalOffset = null, double scale = 1) #Initializes a new instance of the WordWatermark class for the specified header.
Parameters
- wordDocument OfficeIMO.Word.WordDocument
- The parent document.
- wordSection OfficeIMO.Word.WordSection
- The section associated with the header.
- wordHeader OfficeIMO.Word.WordHeader
- The header where the watermark will be placed.
- style OfficeIMO.Word.WordWatermarkStyle
- The type of watermark to add.
- textOrFilePath string
- Text to use or path to the watermark image.
- horizontalOffset OfficeIMO.OfficeLength? = null
- Optional signed horizontal offset.
- verticalOffset OfficeIMO.OfficeLength? = null
- Optional signed vertical offset.
- scale double = 1
- Scale factor for width and height.
Methods
public void Remove() #Removes this watermark from the document by deleting the structured document tag that stores its content.
Inherited Methods
Properties
public OfficeLength? Width { get; set; } #Gets or sets the physical watermark width. Null removes the stored width.
public OfficeLength? Height { get; set; } #Gets or sets the physical watermark height. Null removes the stored height.
public OfficeLength? HorizontalOffset { get; set; } #Gets or sets the signed horizontal offset. Null removes the stored margin-left.
public OfficeLength? VerticalOffset { get; set; } #Gets or sets the signed vertical offset. Null removes the stored margin-top.
public OfficeLength? FontSize { get; set; } #Font size of text watermark in points.
public double? Opacity { get; set; } #Opacity of the watermark fill. Value should be between 0 and 1.
public bool? AllowInCell { get; set; } #Get or Set if watermark is allowed in cell.
public OfficeColor? Color { get; set; } #Gets or sets color of the watermark. Accepted formats for setting the color are named colors (for example, "red") or three- or six-digit hexadecimal strings with or without a leading '#'. Invalid color values will result in ArgumentException being thrown.