ContinuousSectionRestart enumeration
ContinuousSectionRestart enumeration
Represents different behaviors when computing page numbers in a continuous section that restarts page numbering.
Members
Name | Description |
---|---|
ALWAYS | Page numbering always restarts regardless of content flow. |
FROM_NEW_PAGE_ONLY | Page numbering restarts only if there is no other content before the section on the page where the section starts. |
Examples
Shows how to control page numbering in a continuous section.
doc = aw.Document(MY_DIR + "Continuous section page numbering.docx")
# By default Aspose.Words behavior matches the Microsoft Word 2019.
# If you need old Aspose.Words behavior, repetitive Microsoft Word 2016, use 'ContinuousSectionRestart.FROM_NEW_PAGE_ONLY'.
# Page numbering restarts only if there is no other content before the section on the page where the section starts,
# because of that the numbering will reset to 2 from the second page.
doc.layout_options.continuous_section_page_numbering_restart = aw.layout.ContinuousSectionRestart.FROM_NEW_PAGE_ONLY
doc.update_page_layout()
doc.save(ARTIFACTS_DIR + "Layout.restart_page_numbering_in_continuous_section.pdf")
See Also
- module aspose.words.layout