my code is
ParagraphCollection paragraphCollection = section.getBody().getParagraphs();
if (formattingProcessShareVar.getShapeCount() > 0)
{
Paragraph paragraph = new Paragraph(doc);
paragraphCollection.add(paragraph);
paragraph.appendField("TOC \\h \\z \\c \"图\"");
}
// 创建一个新段落用于插入换页符
Paragraph pageBreakParagraph = new Paragraph(doc);
pageBreakParagraph.appendChild(new Run(doc, ControlChar.SECTION_BREAK));
paragraphCollection.add(pageBreakParagraph);
Paragraph tableTitlePara = new Paragraph(doc);
paragraphCollection.add(tableTitlePara);
tableTitlePara.getRuns().add(new Run(doc, "附表清单"));
however, pageBreakParagraph.appendChild(new Run(doc, ControlChar.SECTION_BREAK));
didn’t work. the result is a PageBreak. Is this a restrictiver controlChar that can be only used in Section ?