我找到了解决这一问题的办法。 之所以出现这一问题,是因为微软Word在表末自动增加一段。 这种行为造成一个空白页,因为自动增加的段落,表行到一页末和超支。
https://www.technewstoday.com/page-wont-delete-in-word/#:~:text=Since%20Word%20automatic%20adds%20a, paragraph%20marker%20 that%20Word%20inserted 。
为了在《语言》文件中以人工方式解决这一问题,我采取了以下步骤:
Click on the "Home" tab.
Right-click in front of the paragraph marker at the end of the table.
Choose the "Paragraph" option from the context menu.
In the "Indents and Spacing" tab, set "Before" and "After" fields to 0pt under the "Spacing" section.
Set the line spacing to "Exactly" and the "At" value to 0.7pt (minimum).
之后,我采用类似的方案解决办法,使用XWPF文件实例和Apache POI图书馆。 这里我是如何做的:
XWPFParagraph preventBlankPage = document.createParagraph();
preventBlankPage.setSpacingAfter(0);
preventBlankPage.setSpacingBefore(0);
preventBlankPage.setSpacingBetween(0.1, LineSpacingRule.EXACT);
通过在创建表格之后添加一个空段落,然后将段落前后的间隔时间定为0pt,以及按照“实际上”的行距计算在0.1至0.1之间,我得以防止文件申请增加一个额外的空白页。
This approach ensures that the table s layout remains consistent and avoids the appearance of unnecessary blank pages in the document.