def it_can_change_its_page_width(self, page_width_set_fixture): sectPr, new_page_width, expected_xml = page_width_set_fixture section = Section(sectPr, None) section.page_width = new_page_width assert section._sectPr.xml == expected_xml
def define_page_format(section: Section): """ Define the page setup of a section as default A4 setup (21 cm x 29.7 cm) with 2.5 cm margin. Args: section: Section whose setup will be defined. """ section.orientation = WD_ORIENT.PORTRAIT section.page_width = Cm(21) section.page_height = Cm(29.7) section.top_margin = Cm(2.5) section.bottom_margin = Cm(2.5) section.right_margin = Cm(2.5) section.left_margin = Cm(2.5)