- Work库:free spire.doc.jar 3.9.0
通过textrange.getCharacterFormat()方法读取文本字符串格式,通过paragraph.getFormat()读取段落格式,读取具体文字及段落属性时,可支持读取字体、字号、文字颜色、文字背景、文字是否加粗或倾斜、文字下划线、大小写、边框、上标下标、行距、段落缩进、对齐方式、段落边框、背景等等,下表中罗列了所有可支持读取的样式属性,供参考:
读取文本格式 getCharacterFormat():
方法 |
类型 |
getFontName() |
String |
getFontNameAscii() |
String |
getFontNameBidi() |
String |
getFontNameFarEast() |
String |
getFontNameNonFarEast() |
String |
getBold() |
boolean |
getFontSize() |
float |
getHighlightColor() |
Color |
getItalic() |
boolean |
getTextBackgroundColor() |
Color |
getTextColor() |
Color |
getAllCaps() |
boolean |
getAllowContextualAlternates() |
boolean |
getBidi() |
boolean |
getBoldBidi() |
boolean |
getBorder() |
Border |
getCharacterS |