Paper Office
paper-docxAPI referenceenum.section

WD_ORIENTATION

paper-docx 0.2.0 API reference

Alias: WD_ORIENT

Specifies the page layout orientation.

Example::

from docx.enum.section import WD_ORIENT

section = document.sections[-1] section.orientation = WD_ORIENT.LANDSCAPE

MS API name: WdOrientation MS API URL: http://msdn.microsoft.com/en-us/library/office/ff837902.aspx

Attributes

LANDSCAPE

attributeLANDSCAPE
= (1, 'landscape', 'Landscape orientation.')

Landscape orientation.

PORTRAIT

attributePORTRAIT
= (0, 'portrait', 'Portrait orientation.')

Portrait orientation.

xml_value

attributexml_valuestr | None

Functions

from_xml

funcfrom_xml(xml_value: str | None) -> Self

Enumeration member corresponding to XML attribute value xml_value.

Example::

WD_PARAGRAPH_ALIGNMENT.from_xml("center") WD_PARAGRAPH_ALIGNMENT.CENTER

paramxml_valuestr | None

Returns

typing_extensions.Self

to_xml

functo_xml(value: int | _T | None) -> str | None

XML value of this enum member, generally an XML attribute value.

paramvalueint | _T | None

Returns

str | None

On this page