use_book_fold_printing_settings property

XpsSaveOptions.use_book_fold_printing_settings property

Gets or sets a boolean value indicating whether the document should be saved using a booklet printing layout, if it is specified via PageSetup.multiple_pages.

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

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

Remarks

If this option is specified, FixedPageSaveOptions.page_set is ignored when saving. This behavior matches MS Word. If book fold printing settings are not specified in page setup, this option will have no effect.

Examples

Shows how to save a document to the XPS format in the form of a book fold.

doc = aw.Document(file_name=MY_DIR + 'Paragraphs.docx')
# Create an "XpsSaveOptions" object that we can pass to the document's "Save" method
# to modify how that method converts the document to .XPS.
xps_options = aw.saving.XpsSaveOptions(aw.SaveFormat.XPS)
# Set the "UseBookFoldPrintingSettings" property to "true" to arrange the contents
# in the output XPS in a way that helps us use it to make a booklet.
# Set the "UseBookFoldPrintingSettings" property to "false" to render the XPS normally.
xps_options.use_book_fold_printing_settings = render_text_as_book_fold
# If we are rendering the document as a booklet, we must set the "MultiplePages"
# properties of the page setup objects of all sections to "MultiplePagesType.BookFoldPrinting".
if render_text_as_book_fold:
    for s in doc.sections:
        s = s.as_section()
        s.page_setup.multiple_pages = aw.settings.MultiplePagesType.BOOK_FOLD_PRINTING
# Once we print this document, we can turn it into a booklet by stacking the pages
# to come out of the printer and folding down the middle.
doc.save(file_name=ARTIFACTS_DIR + 'XpsSaveOptions.BookFold.xps', save_options=xps_options)

See Also