How to remove the black cubic before the footnote?

I have used the paragraph.getParagraphFormat().setKeepTogether(true);
and the original result is

it turns to

however , the black cubic before the footnote is not what i want. How can i fix it ?

@Madecho Could you please attach your input and expected output documents here for our reference? We will check them and provide you more information. Unfortunately it is impossible to analyze the problem using screenshots.

@alexey.noskov
test.docx (37.2 KB)

hi alexey, this is the test document. and the code i used is :

Document document = new Document("src/main/test/test.docx");
NodeCollection<Footnote> childNodes = document.getChildNodes(NodeType.FOOTNOTE, true);
for (Footnote footnote : childNodes) {
    for (Paragraph paragraph : footnote.getParagraphs()) {
        paragraph.getParagraphFormat().setKeepTogether(true);
    }
}
document.save("src/main/test/result.docx");

and the result of footnotes have a black cubic ahead of the line

@Madecho This small rectangle before the paragraph is shown by MS Word when show hidden formatting symbols option is enable to mark paragraph, which are marked with Keep Together option. So you can either disable show hidden formatting symbols option in MS Word or reset Keep Together option of paragraph.

@alexey.noskov
but I didn’t enable show show hidden formatting symbols in MS word, but it still exits


and, how can i reset keep together option, so I can erase the black cubic ?
should i use KeepWithText Instead ? I just want the footnote to be on the same page , because some of the footnote maybe separated by pages

@Madecho Please disable this options in MS Word:

@alexey.noskov sorry the weird thing is , I don’t have this option on MS Word, even i googled it.

@Madecho You can use Ctrl+* keyboard shortcut to enable and disable this option.

1 Like