append_document_with_new_page property

ImportFormatOptions.append_document_with_new_page property

Gets or sets a boolean value indicating whether to change a first imported section type to the SectionStart.NEW_PAGE forcibly when call Document.append_document(). The default value is True.

@property
def append_document_with_new_page(self) -> bool:
    ...

@append_document_with_new_page.setter
def append_document_with_new_page(self, value: bool):
    ...

Remarks

Please note that this option is only relevant for the Document.append_document() method and has no effect on other import-related methods.

Examples

Shows how to preserve original section type.

dst_doc = aw.Document()
src_doc = aw.Document()
src_doc.first_section.page_setup.section_start = aw.SectionStart.CONTINUOUS
options = aw.ImportFormatOptions()
options.append_document_with_new_page = False
dst_doc.append_document(src_doc=src_doc, import_format_mode=aw.ImportFormatMode.KEEP_SOURCE_FORMATTING, import_format_options=options)
self.assertEqual(aw.SectionStart.CONTINUOUS, dst_doc.sections[1].page_setup.section_start)

See Also