PageSetup

Overview

PageSetup is a class in Aspose.Words for Python. Inherits from: BaseModel.

PageSetup properties such as paper_size, orientation, margins, and header/footer distances let developers configure page layout for PDF generation.

Properties

NameTypeAccessDescription
paper_sizeintReadRepresents the size of the paper for the section, e.g., A4 or Letter
orientationintReadInteger indicating portrait (0) or landscape (1) page orientation
top_marginfloatReadSpecifies the distance from the top edge to the page content
bottom_marginfloatReadSpecifies the distance from the bottom edge to the page content
left_marginfloatReadSpecifies the distance from the left edge to the page content
right_marginfloatReadSpecifies the distance from the right edge to the page content
header_distancefloatReadDefines the space between the header and the top of the page body
footer_distancefloatReadDefines the space between the footer and the bottom of the page body
page_widthfloatReadFloat representing the total width of the page in points
page_heightfloatReadFloat representing the total height of the page in points
page_number_styleintReadInteger indicating the numbering format (e.g., Arabic, Roman)
page_starting_numberintReadInteger setting the first page number of the section
restart_page_numberingboolReadGets or sets whether numbering restarts at the section start
section_startintReadInteger defining how the section begins (new page, column, etc.)
different_first_page_header_footerboolReadGets or sets a flag for distinct first-page headers/footers
odd_and_even_pages_header_footerboolReadGets or sets a flag for separate odd/even page headers/footers