
In Spire.Doc, you can set the background color of the header text and the whole paragraph of the header.
To set the background color of header text, you may use the code as follows:
- Code: Select all
TextRange text = headerParagraph.AppendText("header");
text.CharacterFormat.TextBackgroundColor = Color.Blue;
To set the background color of the whole header paragraph, you may use the code as follows:
- Code: Select all
headerParagraph.Format.BackColor = Color.Blue;