OfficeIMO

API Reference

Class

WordHeader

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

Represents a single header instance within a section.

Inheritance

Methods

public WordImage AddImageVml(String filePathImage, Nullable<Double> width = null, Nullable<Double> height = null) #
Returns: WordImage

Adds a VML image to the header.

Parameters

filePathImage System.String requiredposition: 0
width System.Nullable{System.Double} = null optionalposition: 1
height System.Nullable{System.Double} = null optionalposition: 2
AddShape 2 overloads
public WordShape AddShape(ShapeType shapeType, Double widthPt, Double heightPt, Color fillColor, Color strokeColor, Double strokeWeightPt = 1, Double arcSize = 0.25) #
Returns: WordShape

Adds a VML shape to the header.

Parameters

shapeType OfficeIMO.Word.ShapeType requiredposition: 0
Type of shape to create.
widthPt System.Double requiredposition: 1
Width in points or line end X.
heightPt System.Double requiredposition: 2
Height in points or line end Y.
fillColor System.String = "#FFFFFF" requiredposition: 3
Fill color in hex format.
strokeColor System.String = "#000000" requiredposition: 4
Stroke color in hex format.
strokeWeightPt System.Double = 1 optionalposition: 5
Stroke weight in points.
arcSize System.Double = 0.25 optionalposition: 6
Corner roundness fraction for rounded rectangles.
AddShape(OfficeIMO.Word.ShapeType shapeType, System.Double widthPt, System.Double heightPt, SixLabors.ImageSharp.Color fillColor, SixLabors.ImageSharp.Color strokeColor, System.Double strokeWeightPt, System.Double arcSize) #

Adds a VML shape to the header using Color values.

Parameters

shapeType OfficeIMO.Word.ShapeType required
widthPt System.Double required
heightPt System.Double required
fillColor SixLabors.ImageSharp.Color required
strokeColor SixLabors.ImageSharp.Color required
strokeWeightPt System.Double required
arcSize System.Double required
public WordShape AddShapeDrawing(ShapeType shapeType, Double widthPt, Double heightPt) #
Returns: WordShape

Adds a DrawingML shape to the header.

Parameters

shapeType OfficeIMO.Word.ShapeType requiredposition: 0
Type of shape to create.
widthPt System.Double requiredposition: 1
Width in points.
heightPt System.Double requiredposition: 2
Height in points.
public WordTextBox AddTextBox(String text, WrapTextImage wrapTextImage = Square) #
Returns: WordTextBox

Adds a text box to the header.

Parameters

text System.String requiredposition: 0
Text contained in the text box.
wrapTextImage OfficeIMO.Word.WrapTextImage = Square optionalposition: 1
Wrapping style.

Returns

The created WordTextBox.

public WordTextBox AddTextBoxVml(String text) #
Returns: WordTextBox

Adds a VML text box to the header.

Parameters

text System.String requiredposition: 0
public WordWatermark AddWatermark(WordWatermarkStyle watermarkStyle, String textOrFilePath, Nullable<Double> horizontalOffset = null, Nullable<Double> verticalOffset = null, Double scale = 1) #
Returns: WordWatermark

Adds a watermark to the header.

Parameters

watermarkStyle OfficeIMO.Word.WordWatermarkStyle requiredposition: 0
Watermark style.
textOrFilePath System.String requiredposition: 1
Text or image path for the watermark.
horizontalOffset System.Nullable{System.Double} = null optionalposition: 2
Horizontal offset in points.
verticalOffset System.Nullable{System.Double} = null optionalposition: 3
Vertical offset in points.
scale System.Double = 1 optionalposition: 4
Scale factor for width and height.

Returns

The created WordWatermark.

RemoveHeaders 2 overloads
public static Void RemoveHeaders(WordDocument document, params HeaderFooterValues[] types) #
Returns: Void

Removes headers from the provided WordprocessingDocument. When no types are specified all headers are removed.

Parameters

wordprocessingDocument DocumentFormat.OpenXml.Packaging.WordprocessingDocument requiredposition: 0
Document to operate on.
types DocumentFormat.OpenXml.Wordprocessing.HeaderFooterValues[] requiredposition: 1
Header types to remove.
RemoveHeaders(OfficeIMO.Word.WordDocument document, DocumentFormat.OpenXml.Wordprocessing.HeaderFooterValues[] types) #

Removes headers from the specified WordDocument. When no types are provided all headers are removed.

Parameters

document OfficeIMO.Word.WordDocument required
Document to operate on.
types DocumentFormat.OpenXml.Wordprocessing.HeaderFooterValues[] required
Header types to remove.