Paper Office
paper-pptxAPI referenceenum.text

PP_PARAGRAPH_ALIGNMENT

paper-pptx 0.2.0 API reference

Specifies the horizontal alignment for one or more paragraphs.

Alias: PP_ALIGN

Example::

from pptx.enum.text import PP_ALIGN

shape.paragraphs[0].alignment = PP_ALIGN.CENTER

MS API Name: PpParagraphAlignment

http://msdn.microsoft.com/en-us/library/office/ff745375(v=office.15).aspx

Attributes

CENTER

attributeCENTER
= (2, 'ctr', 'Center align')

Center align

DISTRIBUTE

attributeDISTRIBUTE
= (5, 'dist', 'Evenly distributes e.g. Japanese characters from left to right within a line')

Evenly distributes e.g. Japanese characters from left to right within a line

JUSTIFY

attributeJUSTIFY
= (4, 'just', 'Justified, i.e. each line both begins and ends at the margin.\n\nSpacing between words is adjusted such that the line exactly fills the width of the paragraph.')

Justified, i.e. each line both begins and ends at the margin.

Spacing between words is adjusted such that the line exactly fills the width of the paragraph.

JUSTIFY_LOW

attributeJUSTIFY_LOW
= (7, 'justLow', 'Justify using a small amount of space between words.')

Justify using a small amount of space between words.

LEFT

attributeLEFT
= (1, 'l', 'Left aligned')

Left aligned

MIXED

attributeMIXED
= (-2, '', 'Multiple alignments are present in a set of paragraphs (read-only).')

Multiple alignments are present in a set of paragraphs (read-only).

attributeRIGHT
= (3, 'r', 'Right aligned')

Right aligned

THAI_DISTRIBUTE

attributeTHAI_DISTRIBUTE
= (6, 'thaiDist', 'Thai distributed')

Thai distributed

xml_value

attributexml_valuestr | None

Functions

from_xml

funcfrom_xml(xml_value: str) -> Self

Enumeration member corresponding to XML attribute value xml_value.

Raises ValueError if xml_value is the empty string ("") or is not an XML attribute value registered on the enumeration. Note that enum members that do not correspond to one of the defined values for an XML attribute have xml_value == "". These "return-value only" members cannot be automatically mapped from an XML attribute value and must be selected explicitly by code, based on the appropriate conditions.

Example::

WD_PARAGRAPH_ALIGNMENT.from_xml("center") WD_PARAGRAPH_ALIGNMENT.CENTER

paramxml_valuestr

Returns

typing_extensions.Self

to_xml

functo_xml(value: int | _T) -> str

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

paramvalueint | _T

Returns

str

validate

funcvalidate(value: _T)

Raise ValueError if value is not an assignable value.

paramvalue_T

On this page