Paper Office
paper-docxAPI referenceenum.text

WD_PARAGRAPH_ALIGNMENT

paper-docx 0.2.0 API reference

Alias: WD_ALIGN_PARAGRAPH

Specifies paragraph justification type.

Example::

from docx.enum.text import WD_ALIGN_PARAGRAPH

paragraph = document.add_paragraph() paragraph.alignment = WD_ALIGN_PARAGRAPH.CENTER

Attributes

CENTER

attributeCENTER
= (1, 'center', 'Center-aligned.')

Center-aligned.

DISTRIBUTE

attributeDISTRIBUTE
= (4, 'distribute', 'Paragraph characters are distributed to fill entire width of paragraph.')

Paragraph characters are distributed to fill entire width of paragraph.

JUSTIFY

attributeJUSTIFY
= (3, 'both', 'Fully justified.')

Fully justified.

JUSTIFY_HI

attributeJUSTIFY_HI
= (7, 'highKashida', 'Justified with a high character compression ratio.')

Justified with a high character compression ratio.

JUSTIFY_LOW

attributeJUSTIFY_LOW
= (8, 'lowKashida', 'Justified with a low character compression ratio.')

Justified with a low character compression ratio.

JUSTIFY_MED

attributeJUSTIFY_MED
= (5, 'mediumKashida', 'Justified with a medium character compression ratio.')

Justified with a medium character compression ratio.

LEFT

attributeLEFT
= (0, 'left', 'Left-aligned')

Left-aligned

attributeRIGHT
= (2, 'right', 'Right-aligned.')

Right-aligned.

THAI_JUSTIFY

attributeTHAI_JUSTIFY
= (9, 'thaiDistribute', 'Justified according to Thai formatting layout.')

Justified according to Thai formatting layout.

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