API Reference
Class
WordBackground
Represents the document background settings.
Inheritance
- Object
- WordBackground
Constructors
WordBackground 2 overloads
public WordBackground(WordDocument document) #Creates a background manager for the specified document.
Parameters
- document OfficeIMO.Word.WordDocument
- Parent document.
public WordBackground(WordDocument document, Color color) #Creates a background with the specified color.
Parameters
- document OfficeIMO.Word.WordDocument
- Parent document.
- color SixLabors.ImageSharp.Color
- Initial color.
Methods
public WordBackground SetColor(Color color) #Returns:
WordBackgroundSets the background color using a Color.
Parameters
- color SixLabors.ImageSharp.Color
- Color value.
Returns
The current instance.
public WordBackground SetColorHex(String color) #Returns:
WordBackgroundSets the background color using a hex value.
Parameters
- color System.String
- Hex color value.
Returns
The current instance.
SetImage 2 overloads
public WordBackground SetImage(String filePath, Nullable<Double> width = null, Nullable<Double> height = null) #Returns:
WordBackgroundSets the background image for the document.
Parameters
- filePath System.String
- Path to the image file.
- width System.Nullable{System.Double} = null
- Optional width of the image in pixels.
- height System.Nullable{System.Double} = null
- Optional height of the image in pixels.
Returns
The current instance.
public WordBackground SetImage(Stream imageStream, String fileName, Nullable<Double> width = null, Nullable<Double> height = null) #Returns:
WordBackgroundSets the background image for the document.
Parameters
- imageStream System.IO.Stream
- Stream containing image data.
- fileName System.String
- Name of the image file.
- width System.Nullable{System.Double} = null
- Optional width of the image in pixels.
- height System.Nullable{System.Double} = null
- Optional height of the image in pixels.
Returns
The current instance.
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object
Properties
public String Color { get; set; } #Gets or sets the background color as a hex string.