OfficeIMO

API Reference

Class

WordBackground

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

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 requiredposition: 0
Parent document.
public WordBackground(WordDocument document, Color color) #

Creates a background with the specified color.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
Parent document.
color SixLabors.ImageSharp.Color requiredposition: 1
Initial color.

Methods

public WordBackground SetColor(Color color) #
Returns: WordBackground

Sets the background color using a Color.

Parameters

color SixLabors.ImageSharp.Color requiredposition: 0
Color value.

Returns

The current instance.

public WordBackground SetColorHex(String color) #
Returns: WordBackground

Sets the background color using a hex value.

Parameters

color System.String requiredposition: 0
Hex color value.

Returns

The current instance.

SetImage 2 overloads
public WordBackground SetImage(String filePath, Nullable<Double> width = null, Nullable<Double> height = null) #
Returns: WordBackground

Sets the background image for the document.

Parameters

filePath System.String requiredposition: 0
Path to the image file.
width System.Nullable{System.Double} = null optionalposition: 1
Optional width of the image in pixels.
height System.Nullable{System.Double} = null optionalposition: 2
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: WordBackground

Sets the background image for the document.

Parameters

imageStream System.IO.Stream requiredposition: 0
Stream containing image data.
fileName System.String requiredposition: 1
Name of the image file.
width System.Nullable{System.Double} = null optionalposition: 2
Optional width of the image in pixels.
height System.Nullable{System.Double} = null optionalposition: 3
Optional height of the image in pixels.

Returns

The current instance.

Properties

public String Color { get; set; } #

Gets or sets the background color as a hex string.