Poppler.StructureElement¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Poppler.StructureElement(**kwargs)¶
- Bases:
- Abstract:
No
- get_abbreviation()¶
- Returns:
Text of the expanded abbreviation if the element text is an abbreviation or acrony,
None
if not.- Return type:
Acronyms and abbreviations contained in elements of type
Poppler.StructureElementKind.SPAN
may have an associated expanded text form, which can be retrieved using this function.New in version 0.26.
- get_actual_text()¶
-
Obtains the actual text enclosed by the element (and its child elements). The actual text is mostly used for non-text elements like images and figures which do have the graphical appearance of text, like a logo. For those the actual text is the equivalent text to those graphical elements which look like text when rendered.
Note that for elements containing proper text, the function
Poppler.StructureElement.get_text
() must be used instead.New in version 0.26.
- get_alt_text()¶
- Returns:
The alternate text representation for the element, or
None
if not defined.- Return type:
Obtains the “alternate” text representation of the element (and its child elements). This is mostly used for non-text elements like images and figures, to specify a textual description of the element.
Note that for elements containing proper text, the function
Poppler.StructureElement.get_text
() must be used instead.New in version 0.26.
- get_background_color()¶
- Returns:
True
if a color is defined for the element,False
otherwise.- color:
- Return type:
(
bool
, color:Poppler.Color
)
Obtains the background color of the element. If this attribute is not specified, the element shall be treated as if it were transparent.
New in version 0.26.
- get_baseline_shift()¶
- Returns:
A numeric value.
- Return type:
Obtains how much the text contained in the inline-level structure element should be shifted, measuring from the baseline of the glyphs.
New in version 0.26.
- get_block_align()¶
- Returns:
A
Poppler.StructureBlockAlign
value.- Return type:
Obtains the block-alignment mode of the block-level structure element.
New in version 0.26.
- get_border_color()¶
- Returns:
True
if a color is defined for the element,False
otherwise.- colors:
An array of four
Poppler.Color
.
- Return type:
(
bool
, colors: [Poppler.Color
])
Obtains the color of border around the element. The result values are in before-after-start-end ordering (for the typical Western left-to-right writing, that is top-bottom-left-right). If this attribute is not specified, the border color for this element shall be the current text fill color in effect at the start of its associated content.
New in version 0.26.
- get_border_style()¶
- Returns:
An array of four
Poppler.StructureBorderStyle
elements.- Return type:
border_styles: [
Poppler.StructureBorderStyle
]
Obtains the border style of a structure element. The result values are in before-after-start-end ordering. For example, using Western left-to-right writing, that is top-bottom-left-right.
New in version 0.26.
- get_border_thickness()¶
- Returns:
True
if the border thickness attribute is defined for the element,False
otherwise.- border_thicknesses:
Array with the four values of border thicknesses.
- Return type:
Obtains the thickness of the border of an element. The result values are in before-after-start-end ordering (for the typical Western left-to-right writing, that is top-bottom-left-right). A value of 0 indicates that the border shall not be drawn.
New in version 0.26.
- get_bounding_box()¶
- Returns:
True
if a bounding box is defined for the element,False
otherwise.- bounding_box:
- Return type:
(
bool
, bounding_box:Poppler.Rectangle
)
Obtains the size of the bounding box of a block-level structure element.
New in version 0.26.
- get_color()¶
- Returns:
True
if a color is defined for the element,False
otherwise.- color:
- Return type:
(
bool
, color:Poppler.Color
)
Obtains the color of the content contained in the element. If this attribute is not specified, the color for this element shall be the current text fill color in effect at the start of its associated content.
New in version 0.26.
- get_column_count()¶
- Returns:
Number of columns.
- Return type:
Obtains the number of columns used to lay out the content contained in the grouping element.
New in version 0.26.
- get_column_gaps()¶
- Returns:
Array containing the values for the column gaps, or
None
if the array is empty or the attribute is not defined.- Return type:
[
float
]
Obtains the size of the gaps in between adjacent columns. Returns an array of elements: the first one is the size of the gap in between columns 1 and 2, second is the size between columns 2 and 3, and so on.
For elements which use a single column,
None
is returned and n_values is set to zero.If the attribute is undefined,
None
is returned and n_values is set to a non-zero value.The array with the results is allocated by the function. When it is not needed anymore, be sure to call
GLib.free
() on it.New in version 0.26.
- get_column_widths()¶
- Returns:
Array containing widths of the columns, or
None
if the attribute is not defined.- Return type:
[
float
]
Obtains an array with the widths of the columns.
The array with the results is allocated by the function. When it is not needed anymore, be sure to call
GLib.free
() on it.New in version 0.26.
- get_end_indent()¶
- Returns:
A numeric value.
- Return type:
Obtains the amount of indentation at the end of the block-level structure element.
New in version 0.26.
- get_form_description()¶
-
Obtains the textual description of the form element. Note that the description is for informative purposes, and it is not intended to be rendered. For example, assistive technologies may use the description field to provide an alternate way of presenting an element to the user.
The returned string is allocated by the function. When it is not needed anymore, be sure to call
GLib.free
() on it.New in version 0.26.
- get_form_role()¶
- Returns:
A
Poppler.StructureFormRole
value.- Return type:
Obtains the role of a form structure element that is part of a form, or is a form field. This hints how the control for the element is intended to be rendered.
New in version 0.26.
- get_form_state()¶
- Returns:
A
Poppler.StructureFormState
value.- Return type:
For a structure element that is a form field, obtains in which state the associated control is expected to be rendered.
New in version 0.26.
- get_glyph_orientation()¶
- Returns:
A
Poppler.StructureGlyphOrientation
value.- Return type:
Obtains the glyph orientation for the text contained in a inline-level structure element.
New in version 0.26.
- get_height()¶
- Returns:
A positive value if a width is defined, or -1 if the height is to be calculated automatically.
- Return type:
Obtains the height of the block-level structure element. Note that for elements which do not specify a height, it has to be calculated, and in this case -1 is returned.
New in version 0.26.
- get_id()¶
-
Obtains the identifier of an element.
New in version 0.26.
- get_inline_align()¶
- Returns:
A
Poppler.StructureInlineAlign
value.- Return type:
Obtains the inline-alignment mode of the block-level structure element.
New in version 0.26.
- get_kind()¶
- Returns:
A
Poppler.StructureElementKind
value.- Return type:
New in version 0.26.
- get_language()¶
-
Obtains the language and country code for the content in an element, in two-letter ISO format, e.g. en_ES, or
None
if not defined.New in version 0.26.
- get_line_height()¶
- Returns:
A positive value if a line height is defined, or -1 if the height is to be calculated automatically.
- Return type:
Obtains the line height for the text contained in the inline-level structure element. Note that for elements which do not specify a line height, it has to be calculated, and in this case -1 is returned.
New in version 0.26.
- get_list_numbering()¶
- Returns:
A
Poppler.StructureListNumbering
value.- Return type:
Obtains the list numbering style for list items.
New in version 0.26.
- get_padding()¶
- Returns:
Padding for the four sides of the element.
- Return type:
paddings: [
float
]
Obtains the padding of an element (space around it). The result values are in before-after-start-end ordering. For example using Western left-to-right writing, that is top-bottom-left-right.
New in version 0.26.
- get_page()¶
- Returns:
Number of the page that contains the element, of
-1 if not defined.
- Return type:
Obtains the page number in which the element is contained.
New in version 0.26.
- get_placement()¶
- Returns:
A
Poppler.StructurePlacement
value.- Return type:
Obtains the placement type of the structure element.
New in version 0.26.
- get_ruby_align()¶
- Returns:
A
Poppler.StructureRubyAlign
value.- Return type:
Obtains the alignment for the ruby text contained in a inline-level structure element.
New in version 0.26.
- get_ruby_position()¶
- Returns:
A
Poppler.StructureRubyPosition
value.- Return type:
Obtains the position for the ruby text contained in a inline-level structure element.
New in version 0.26.
- get_space_after()¶
- Returns:
A positive value.
- Return type:
Obtains the amount of empty space after the block-level structure element.
New in version 0.26.
- get_space_before()¶
- Returns:
A positive value.
- Return type:
Obtains the amount of empty space before the block-level structure element.
New in version 0.26.
- get_start_indent()¶
- Returns:
A numeric value.
- Return type:
Obtains the amount of indentation at the beginning of the block-level structure element.
New in version 0.26.
- get_table_border_style()¶
- Returns:
An array of four
Poppler.StructureBorderStyle
elements.- Return type:
border_styles: [
Poppler.StructureBorderStyle
]
Obtains the table cell border style of a block-level structure element. The result values are in before-after-start-end ordering. For example, using Western left-to-right writing, that is top-bottom-left-right.
New in version 0.26.
- get_table_column_span()¶
- Returns:
A positive, non-zero value.
- Return type:
Obtains the number of columns the table element spans to.
New in version 0.26.
- get_table_headers()¶
- Returns:
Zero-terminated array of strings with the table header names, or
None
if the attribute is not defined.- Return type:
[
str
]
Obtains an array with the names of the table column headers. This is only useful for table header row elements.
The array with the results is allocated by the function. The number of items in the returned array can be obtained with
GLib.strv_length
(). The returned value must be freed usingGLib.strfreev
().New in version 0.26.
- get_table_padding()¶
- Returns:
Padding for the four sides of the element.
- Return type:
paddings: [
float
]
Obtains the padding between the table cell’s content rectangle and the surrounding border of a block-level structure element. The result values are in before-after-start-end ordering (for the typical Western left-to-right writing, that is top-bottom-left-right).
New in version 0.26.
- get_table_row_span()¶
- Returns:
A positive, non-zero value.
- Return type:
Obtains the number of rows the table element spans to.
New in version 0.26.
- get_table_scope()¶
- Returns:
A
Poppler.StructureTableScope
value.- Return type:
Obtains the scope of a table structure element.
New in version 0.26.
- get_table_summary()¶
-
Obtains the textual summary of the contents of the table element. Note that the summary is meant for informative purposes, and it is not intended to be rendered. For example, assistive technologies may use the description field to provide an alternate way of presenting an element to the user, or a document indexer may want to scan it for additional keywords.
The returned string is allocated by the function. When it is not needed anymore, be sure to call
GLib.free
() on it.New in version 0.26.
- get_text(flags)¶
- Parameters:
flags (
Poppler.StructureGetTextFlags
) – APoppler.StructureGetTextFlags
value, orPoppler.StructureGetTextFlags.NONE
to disable all the flags.- Returns:
A string.
- Return type:
Obtains the text enclosed by an element, or the text enclosed by the elements in the subtree (including the element itself).
New in version 0.26.
- get_text_align()¶
- Returns:
A
Poppler.StructureTextAlign
value.- Return type:
Obtains the text alignment mode of the text contained into a block-level structure element.
New in version 0.26.
- get_text_decoration_color()¶
- Returns:
True
if a color is defined for the element,False
otherwise.- color:
- Return type:
(
bool
, color:Poppler.Color
)
Obtains the color of the text decoration for the text contained in the inline-level structure element. If this attribute is not specified, the color for this element shall be the current fill color in effect at the start of its associated content.
New in version 0.26.
- get_text_decoration_thickness()¶
- Returns:
Thickness of the text decoration, or NAN if not defined.
- Return type:
Obtains the thickness of the text decoration for the text contained in the inline-level structure element. If this attribute is not specified, it shall be derived from the current stroke thickness in effect at the start of the element’s associated content.
New in version 0.26.
- get_text_decoration_type()¶
- Returns:
A
Poppler.StructureTextDecoration
value.- Return type:
Obtains the text decoration type of the text contained in the inline-level structure element.
New in version 0.26.
- get_text_indent()¶
- Returns:
A numeric value.
- Return type:
Obtains the amount of indentation of the text contained in the block-level structure element.
New in version 0.26.
- get_text_spans()¶
- Returns:
An array of
Poppler.TextSpan
elements.- Return type:
Obtains the text enclosed by an element, as an array of
Poppler.TextSpan
structures. Each item in the list is a piece of text which share the same attributes, plus its attributes. The following example shows how to obtain and free the text spans of an element:<informalexample><programlisting>
int
i, n_spans;Poppler.TextSpan
**text_spans =Poppler.StructureElement.get_text_spans
(element, &n_spans); /<!– –>* Use the text spans *<!– –>/ for (i = 0; i < n_spans; i++)Poppler.TextSpan.free
(text_spans[i]);GLib.free
(text_spans); </programlisting></informalexample>New in version 0.26.
- get_title()¶
-
Obtains the title of an element.
New in version 0.26.
- get_width()¶
- Returns:
A positive value if a width is defined, or -1 if the width is to be calculated automatically.
- Return type:
Obtains the width of the block-level structure element. Note that for elements which do not specify a width, it has to be calculated, and in this case -1 is returned.
New in version 0.26.
- get_writing_mode()¶
- Returns:
A
Poppler.StructureWritingMode
value.- Return type:
Obtains the writing mode (writing direction) of the content associated with a structure element.
New in version 0.26.
- is_block()¶
-
Checks whether an element is a block element.
New in version 0.26.
- is_content()¶
-
Checks whether an element is actual document content.
New in version 0.26.
- is_grouping()¶
-
Checks whether an element is a grouping element.
New in version 0.26.