Fix cover page: use valid page break so content starts on page 2
This commit is contained in:
@@ -58,15 +58,7 @@ def _add_blank_lines(doc: Document, count: int):
|
||||
def _add_page_break(doc: Document):
|
||||
"""Insert a page break paragraph to force next content to page 2."""
|
||||
p = doc.add_paragraph()
|
||||
pPr = p._p.get_or_add_pPr()
|
||||
# Clean existing formatting
|
||||
for child in list(pPr):
|
||||
tag = child.tag.split("}")[-1] if "}" in child.tag else child.tag
|
||||
if tag in ("tabs", "spacing", "ind"):
|
||||
pPr.remove(child)
|
||||
page_break = OxmlElement("w:pageBreak")
|
||||
page_break.set("{http://schemas.openxmlformats.org/wordprocessingml/2006/main}val", "1")
|
||||
pPr.append(page_break)
|
||||
p.paragraph_format.page_break_before = True
|
||||
|
||||
|
||||
def add_cover_page(
|
||||
|
||||
Reference in New Issue
Block a user