Fix cover page: use run-level page break to avoid extra blank line
This commit is contained in:
@@ -56,9 +56,10 @@ def _add_blank_lines(doc: Document, count: int):
|
|||||||
|
|
||||||
|
|
||||||
def _add_page_break(doc: Document):
|
def _add_page_break(doc: Document):
|
||||||
"""Insert a page break paragraph to force next content to page 2."""
|
"""Insert a page break after the last paragraph (no extra blank line)."""
|
||||||
p = doc.add_paragraph()
|
last_p = doc.paragraphs[-1]
|
||||||
p.paragraph_format.page_break_before = True
|
run = last_p.add_run()
|
||||||
|
run.add_break(type=1) # WD_BREAK.PAGE = 1
|
||||||
|
|
||||||
|
|
||||||
def add_cover_page(
|
def add_cover_page(
|
||||||
|
|||||||
Reference in New Issue
Block a user