@arunkamboj
Above, we have described how to format image in the Header/Footer of the Word Document.
For Text formatting, you may consider PostDocumentParagraphRunFont API.
Here is an example:
name = SampleDocument.docx
fontDto = {
“AllCaps”: false,
“Bidi”: false,
“Bold”: true,
“BoldBi”: false,
“Border”: {
“LineStyle”: “None”,
“LineWidth”: 0,
“Color”: {
“@Web”: “”,
“@Alpha”: 0
},
“DistanceFromText”: 0,
“Shadow”: false
},
“Color”: {
“@Web”: “”,
“@Alpha”: 0
},
“ComplexScript”: false,
“DoubleStrikeThrough”: false,
“Emboss”: false,
“Engrave”: false,
“Hidden”: false,
“HighlightColor”: {
“@Web”: “”,
“@Alpha”: 0
},
“Italic”: true,
“ItalicBi”: false,
“Kerning”: 0,
“LocaleId”: 1033,
“LocaleIdBi”: 1025,
“LocaleIdFarEast”: 1033,
“Name”: “Calibri”,
“NameAscii”: “Calibri”,
“NameBi”: “Times New Roman”,
“NameFarEast”: “Calibri”,
“NameOther”: “Calibri”,
“NoProofing”: false,
“Outline”: false,
“Position”: 0,
“Scaling”: 100,
“Shadow”: false,
“Size”: 11,
“SizeBi”: 11,
“SmallCaps”: false,
“Spacing”: 0,
“StrikeThrough”: false,
“StyleIdentifier”: “DefaultParagraphFont”,
“StyleName”: “Default Paragraph Font”,
“Subscript”: false,
“Superscript”: false,
“TextEffect”: “None”,
“Underline”: “Dash”,
“UnderlineColor”: {
“@Web”: “#A5A5A5”
}
}
paragraphPath = sections/0/headersfooters/0/paragraphs/0
index = 0
Following is the description of Font object attributes:
Property Name |
Type |
Description |
AllCaps |
bool |
True if the font is formatted as all capital letters. |
Bidi |
bool |
Specifies whether the contents of this run shall have right-to-left characteristics. |
Bold |
bool |
True if the font is formatted as bold. |
BoldBi |
bool |
True if the right-to-left text is formatted as bold. |
Border |
Border |
Border object that specifies border for the font. |
Color |
Color |
Gets or sets the color of the font. |
ComplexScript |
bool |
Specifies whether the contents of this run shall be treated as complex script text regardless of their Unicode character values when determining the formatting for this run. |
DoubleStrikeThrough |
bool |
True if the font is formatted as double strikethrough text. |
Emboss |
bool |
True if the font is formatted as embossed. |
Engrave |
bool |
True if the font is formatted as engraved. |
Hidden |
bool |
True if the font is formatted as hidden text. |
HighlightColor |
Color |
Gets or sets the highlight (marker) color. |
Italic |
bool |
True if the font is formatted as italic. |
ItalicBi |
bool |
True if the right-to-left text is formatted as italic. |
Kerning |
double |
Gets or sets the font size at which kerning starts. |
LocaleId |
int |
Gets or sets the locale identifier (language) of the formatted characters. For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx |
LocaleIdBi |
int |
Gets or sets the locale identifier (language) of the formatted right-to-left characters. For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx |
LocaleIdFarEast |
int |
Gets or sets the locale identifier (language) of the formatted Asian characters. For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx |
Name |
string |
Gets or sets the name of the font. |
NameAscii |
bool |
Returns or sets the font used for Latin text (characters with character codes from 0 (zero) through 127). |
NameBi |
bool |
TReturns or sets the name of the font in a right-to-left language document. |
NameFarEast |
bool |
Returns or sets an East Asian font name. |
NameOther |
bool |
Returns or sets the font used for characters with character codes from 128 through 255. |
NoProofing |
bool |
True when the formatted characters are not to be spell checked. |
Outline |
bool |
True if the font is formatted as outline. |
Position |
double |
Gets or sets the position of text (in points) relative to the base line. A positive number raises the text, and a negative number lowers it. |
Scaling |
int |
Gets or sets character width scaling in percent. |
Shadow |
bool |
True if the font is formatted as shadowed. |
Size |
double |
Gets or sets the font size in points. |
SizeBi |
double |
Gets or sets the font size in points used in a right-to-left document. |
SmallCaps |
bool |
True if the font is formatted as small capital letters. |
Spacing |
double |
Returns or sets the spacing (in points) between characters. |
StrikeThrough |
bool |
True if the font is formatted as strikethrough text. |
StyleIdentifier |
StyleIdentifier |
Gets or sets the locale independent style identifier of the character style applied to this formatting. |
StyleName |
string |
Gets or sets the name of the character style applied to this formatting. |
Subscript |
bool |
True if the font is formatted as subscript. |
Superscript |
bool |
True if the font is formatted as superscript. |
TextEffect |
TextEffect |
Gets or sets the font animation effect. |
Underline |
Underline |
Gets or sets the type of underline applied to the font. |
UnderlineColor |
Color |
Gets or sets the color of the underline applied to the font. |