API Reference
Class
WordHeader
Represents a single header instance within a section.
Inheritance
- WordHeaderFooter
- WordHeader
Methods
public WordImage AddImageVml(String filePathImage, Nullable<Double> width = null, Nullable<Double> height = null) #Returns:
WordImageAdds a VML image to the header.
Parameters
- filePathImage System.String
- width System.Nullable{System.Double} = null
- height System.Nullable{System.Double} = null
AddShape 2 overloads
public WordShape AddShape(ShapeType shapeType, Double widthPt, Double heightPt, Color fillColor, Color strokeColor, Double strokeWeightPt = 1, Double arcSize = 0.25) #Returns:
WordShapeAdds a VML shape to the header.
Parameters
- shapeType OfficeIMO.Word.ShapeType
- Type of shape to create.
- widthPt System.Double
- Width in points or line end X.
- heightPt System.Double
- Height in points or line end Y.
- fillColor System.String = "#FFFFFF"
- Fill color in hex format.
- strokeColor System.String = "#000000"
- Stroke color in hex format.
- strokeWeightPt System.Double = 1
- Stroke weight in points.
- arcSize System.Double = 0.25
- 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
- widthPt System.Double
- heightPt System.Double
- fillColor SixLabors.ImageSharp.Color
- strokeColor SixLabors.ImageSharp.Color
- strokeWeightPt System.Double
- arcSize System.Double
public WordShape AddShapeDrawing(ShapeType shapeType, Double widthPt, Double heightPt) #Returns:
WordShapeAdds a DrawingML shape to the header.
Parameters
- shapeType OfficeIMO.Word.ShapeType
- Type of shape to create.
- widthPt System.Double
- Width in points.
- heightPt System.Double
- Height in points.
public WordTextBox AddTextBox(String text, WrapTextImage wrapTextImage = Square) #Returns:
WordTextBoxAdds a text box to the header.
Parameters
- text System.String
- Text contained in the text box.
- wrapTextImage OfficeIMO.Word.WrapTextImage = Square
- Wrapping style.
Returns
The created WordTextBox.
public WordTextBox AddTextBoxVml(String text) #Returns:
WordTextBoxAdds a VML text box to the header.
Parameters
- text System.String
public WordWatermark AddWatermark(WordWatermarkStyle watermarkStyle, String textOrFilePath, Nullable<Double> horizontalOffset = null, Nullable<Double> verticalOffset = null, Double scale = 1) #Returns:
WordWatermarkAdds a watermark to the header.
Parameters
- watermarkStyle OfficeIMO.Word.WordWatermarkStyle
- Watermark style.
- textOrFilePath System.String
- Text or image path for the watermark.
- horizontalOffset System.Nullable{System.Double} = null
- Horizontal offset in points.
- verticalOffset System.Nullable{System.Double} = null
- Vertical offset in points.
- scale System.Double = 1
- Scale factor for width and height.
Returns
The created WordWatermark.
RemoveHeaders 2 overloads
Inherited Methods
public WordParagraph AddBookmark(String bookmarkName) #Returns:
WordParagraphInherited from WordHeaderFooter
Parameters
- bookmarkName String
public WordParagraph AddField(WordFieldBuilder builder, Boolean advanced = false) #Returns:
WordParagraphInherited from WordHeaderFooter
Parameters
- wordFieldType WordFieldType
- wordFieldFormat Nullable<WordFieldFormat> = false
- customFormat String = null
- advanced Boolean = false
public WordParagraph AddHorizontalLine(Nullable<BorderValues> lineType = null, Nullable<Color> color = null, UInt32 size = 12, UInt32 space = 1) #Returns:
WordParagraphInherited from WordHeaderFooter
Parameters
- lineType Nullable<BorderValues> = null
- color Nullable<Color> = null
- size UInt32 = 12
- space UInt32 = 1
public WordParagraph AddHyperLink(String text, String anchor, Boolean addStyle = false, String tooltip = "", Boolean history = true) #Returns:
WordParagraphInherited from WordHeaderFooter
Parameters
- text String
- uri Uri
- addStyle Boolean = false
- tooltip String = ""
- history Boolean = true
public WordList AddList(WordListStyle style) #Returns:
WordListInherited from WordHeaderFooter
Parameters
- style WordListStyle
public WordParagraph AddPageNumber(Boolean includeTotalPages = false, Nullable<WordFieldFormat> format = null, String separator = " of ") #Returns:
WordParagraphInherited from WordHeaderFooter
Adds a page number field to the header.
Parameters
- wordPageNumberStyle OfficeIMO.Word.WordPageNumberStyle = false
- The numbering style to apply.
Returns
The created WordPageNumber.
public WordParagraph AddParagraph(Boolean newRun = false) #Returns:
WordParagraphInherited from WordHeaderFooter
Parameters
- text String = false
public WordTable AddTable(Int32 rows, Int32 columns, WordTableStyle tableStyle = TableGrid) #Returns:
WordTableInherited from WordHeaderFooter
Parameters
- rows Int32
- columns Int32
- tableStyle WordTableStyle = TableGrid
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object
Inherited Properties
public List<WordParagraph> Paragraphs { get; } #Inherited from WordHeaderFooter
public List<WordElement> Elements { get; } #Inherited from WordHeaderFooter
public List<WordTable> Tables { get; } #Inherited from WordHeaderFooter
public List<WordTextBox> TextBoxes { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsPageBreaks { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsHyperLinks { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsFields { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsBookmarks { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsEquations { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsStructuredDocumentTags { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsCheckBoxes { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsDatePickers { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsDropDownLists { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsRepeatingSections { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsImages { get; } #Inherited from WordHeaderFooter
public List<WordParagraph> ParagraphsSmartArts { get; } #Inherited from WordHeaderFooter
public List<WordBreak> PageBreaks { get; } #Inherited from WordHeaderFooter
public List<WordImage> Images { get; } #Inherited from WordHeaderFooter
public List<WordSmartArt> SmartArts { get; } #Inherited from WordHeaderFooter
public List<WordBookmark> Bookmarks { get; } #Inherited from WordHeaderFooter
public List<WordField> Fields { get; } #Inherited from WordHeaderFooter
public List<WordHyperLink> HyperLinks { get; } #Inherited from WordHeaderFooter
public List<WordEquation> Equations { get; } #Inherited from WordHeaderFooter
public List<WordStructuredDocumentTag> StructuredDocumentTags { get; } #Inherited from WordHeaderFooter
public List<WordCheckBox> CheckBoxes { get; } #Inherited from WordHeaderFooter
public List<WordDatePicker> DatePickers { get; } #Inherited from WordHeaderFooter
public List<WordDropDownList> DropDownLists { get; } #Inherited from WordHeaderFooter
public List<WordRepeatingSection> RepeatingSections { get; } #Inherited from WordHeaderFooter
public List<WordWatermark> Watermarks { get; } #Inherited from WordHeaderFooter