TextBlock

Overview

TextBlock is a class in Aspose.PDF FOSS for Python.

Paragraphs ready to be placed on a page, with the styles they share.

This class declares 3 methods for TextBlock objects in Python programs. Available methods include: __post_init__, add_paragraph, add_paragraphs. Public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package. Properties: alignment, first_line_indent, font, font_name, font_size, is_empty, and 6 more.

Properties

NameTypeAccessDescription
is_emptyboolReadWhether there is nothing here that would put a mark on a page.
textAnyRead/WriteGets or sets the text.
widthfloat | NoneRead/WriteGets or sets the width.
font_namestrRead/WriteGets or sets the font name.
font_sizefloatRead/WriteGets or sets the font size.
fontAnyRead/WriteGets or sets the font.
text_colorAnyRead/WriteGets or sets the text color.
alignmentstrRead/WriteGets or sets the alignment.
line_heightfloat | NoneRead/WriteGets or sets the line height.
paragraph_gapfloatRead/WriteGets or sets the paragraph gap.
first_line_indentfloatRead/WriteGets or sets the first line indent.
paragraphslist[Paragraph]Read/WriteGets or sets the paragraphs.

Methods

SignatureDescription
__post_init__()Calls post_init on this TextBlock instance.
add_paragraph(text: Any) → ParagraphAppend a paragraph and return it.
add_paragraphs(text: str) → list[Paragraph]Append one paragraph per blank-line-separated block of text.

See Also