@alexey.noskov hello dear alexey !!!
as you can see, the [34] is connected with certain ‘reference citation’ but after I process this paragraph with code ’
public void formatParagraphText(Paragraph paragraph) throws Exception {
StyleUtils.merge(paragraph.getParagraphFormat(), styleConfigDto.getText(), StyleIdentifier.NORMAL, true);
Run previousRun = new Run(null);
for (int i = 0; i < paragraph.getRuns().getCount(); i++) {
Run run = paragraph.getRuns().get(i);
String previousRunText = previousRun.getText();
String currentRunText = run.getText();
if(run.getText().contains("ADDIN"))
continue;
StyleUtils.merge(run.getFont(), styleConfigDto.getText());
previousRun = run;
}
}
the ouput becomes
which is a pure text, but when I debugged to this paragraph, the getText()
still shows the field content , something like ‘ADDIN’, but not as before anymore, how can I fix it? because, i just want to format the style of the content, maybe setSuperscript
with number like [xx]
, but I dont want to lose its reference
the original file is here
上标测试_demo.docx (45.8 KB)