|
@@ -423,9 +423,15 @@ public class WordStructuredExtractionService {
|
|
|
|
|
|
|
|
// 上下标
|
|
// 上下标
|
|
|
try {
|
|
try {
|
|
|
- VerticalAlign vertAlign = xwpfRun.getVerticalAlignment();
|
|
|
|
|
- if (vertAlign != null && vertAlign != VerticalAlign.BASELINE) {
|
|
|
|
|
- run.setVerticalAlign(vertAlign.name().toLowerCase());
|
|
|
|
|
|
|
+ // getVerticalAlignment() 返回 STVerticalAlignRun.Enum
|
|
|
|
|
+ Object vertAlign = xwpfRun.getVerticalAlignment();
|
|
|
|
|
+ if (vertAlign != null) {
|
|
|
|
|
+ String alignStr = vertAlign.toString().toLowerCase();
|
|
|
|
|
+ if ("superscript".equals(alignStr)) {
|
|
|
|
|
+ run.setVerticalAlign("superscript");
|
|
|
|
|
+ } else if ("subscript".equals(alignStr)) {
|
|
|
|
|
+ run.setVerticalAlign("subscript");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
// 某些版本可能不支持
|
|
// 某些版本可能不支持
|