openpyxl.worksheet.page module

class openpyxl.worksheet.page.PageMargins(left=0.75, right=0.75, top=1, bottom=1, header=0.5, footer=0.5)[source]

Bases: openpyxl.descriptors.serialisable.Serialisable

Information about page margins for view/print layouts. Standard values (in inches) left, right = 0.75 top, bottom = 1 header, footer = 0.5

bottom

Values must be of type <class ‘float’>

footer

Values must be of type <class ‘float’>

header

Values must be of type <class ‘float’>

left

Values must be of type <class ‘float’>

right

Values must be of type <class ‘float’>

tagname = 'pageMargins'
top

Values must be of type <class ‘float’>

class openpyxl.worksheet.page.PrintOptions(horizontalCentered=None, verticalCentered=None, headings=None, gridLines=None, gridLinesSet=None)[source]

Bases: openpyxl.descriptors.serialisable.Serialisable

Worksheet print options

gridLines

Values must be of type <class ‘bool’>

gridLinesSet

Values must be of type <class ‘bool’>

headings

Values must be of type <class ‘bool’>

horizontalCentered

Values must be of type <class ‘bool’>

tagname = 'printOptions'
verticalCentered

Values must be of type <class ‘bool’>

class openpyxl.worksheet.page.PrintPageSetup(worksheet=None, orientation=None, paperSize=None, scale=None, fitToHeight=None, fitToWidth=None, firstPageNumber=None, useFirstPageNumber=None, paperHeight=None, paperWidth=None, pageOrder=None, usePrinterDefaults=None, blackAndWhite=None, draft=None, cellComments=None, errors=None, horizontalDpi=None, verticalDpi=None, copies=None, id=None)[source]

Bases: openpyxl.descriptors.serialisable.Serialisable

Worksheet print page setup

autoPageBreaks
blackAndWhite

Values must be of type <class ‘bool’>

cellComments

Value must be one of {‘asDisplayed’, ‘atEnd’}

copies

Values must be of type <class ‘int’>

draft

Values must be of type <class ‘bool’>

errors

Value must be one of {‘blank’, ‘dash’, ‘displayed’, ‘NA’}

firstPageNumber

Values must be of type <class ‘int’>

fitToHeight

Values must be of type <class ‘int’>

fitToPage
fitToWidth

Values must be of type <class ‘int’>

classmethod from_tree(node)[source]

Create object from XML

horizontalDpi

Values must be of type <class ‘int’>

id

Values must be of type <class ‘str’>

orientation

Value must be one of {‘default’, ‘portrait’, ‘landscape’}

pageOrder

Value must be one of {‘downThenOver’, ‘overThenDown’}

paperHeight
paperSize

Values must be of type <class ‘int’>

paperWidth
scale

Values must be of type <class ‘int’>

sheet_properties

Proxy property

tagname = 'pageSetup'
useFirstPageNumber

Values must be of type <class ‘bool’>

usePrinterDefaults

Values must be of type <class ‘bool’>

verticalDpi

Values must be of type <class ‘int’>