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 | NoneFunctions
from_xml
funcfrom_xml(xml_value: str | None) -> SelfEnumeration member corresponding to XML attribute value xml_value.
Example::
WD_PARAGRAPH_ALIGNMENT.from_xml("center") WD_PARAGRAPH_ALIGNMENT.CENTER
paramxml_valuestr | NoneReturns
typing_extensions.Selfto_xml
functo_xml(value: int | _T | None) -> str | NoneXML value of this enum member, generally an XML attribute value.
paramvalueint | _T | NoneReturns
str | None