From 811be82a719d56c92cb44b6662628f877b22079d Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 20 Jun 2026 03:34:28 +0000 Subject: [PATCH] Fix cover page: use run-level page break to avoid extra blank line --- scraibe/docx_cover.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scraibe/docx_cover.py b/scraibe/docx_cover.py index 686b696..6624b13 100644 --- a/scraibe/docx_cover.py +++ b/scraibe/docx_cover.py @@ -56,9 +56,10 @@ 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() - p.paragraph_format.page_break_before = True + """Insert a page break after the last paragraph (no extra blank line).""" + last_p = doc.paragraphs[-1] + run = last_p.add_run() + run.add_break(type=1) # WD_BREAK.PAGE = 1 def add_cover_page(