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
| Name | Type | Access | Description |
|---|---|---|---|
is_empty | bool | Read | Whether there is nothing here that would put a mark on a page. |
text | Any | Read/Write | Gets or sets the text. |
width | float | None | Read/Write | Gets or sets the width. |
font_name | str | Read/Write | Gets or sets the font name. |
font_size | float | Read/Write | Gets or sets the font size. |
font | Any | Read/Write | Gets or sets the font. |
text_color | Any | Read/Write | Gets or sets the text color. |
alignment | str | Read/Write | Gets or sets the alignment. |
line_height | float | None | Read/Write | Gets or sets the line height. |
paragraph_gap | float | Read/Write | Gets or sets the paragraph gap. |
first_line_indent | float | Read/Write | Gets or sets the first line indent. |
paragraphs | list[Paragraph] | Read/Write | Gets or sets the paragraphs. |
Methods
| Signature | Description |
|---|---|
__post_init__() | Calls post_init on this TextBlock instance. |
add_paragraph(text: Any) → Paragraph | Append a paragraph and return it. |
add_paragraphs(text: str) → list[Paragraph] | Append one paragraph per blank-line-separated block of text. |