Poppler.StructureElementIter

Fields

None

Methods

class

new (poppler_document)

copy ()

free ()

get_child ()

get_element ()

next ()

Details

class Poppler.StructureElementIter
classmethod new(poppler_document)
Parameters:

poppler_document (Poppler.Document) – a Poppler.Document.

Returns:

a new Poppler.StructureElementIter, or None if document doesn’t have structure tree.

Return type:

Poppler.StructureElementIter

Returns the root Poppler.StructureElementIter for document, or None. The returned value must be freed with Poppler.StructureElementIter.free().

Documents may have an associated structure tree —mostly, Tagged-PDF compliant documents— which can be used to obtain information about the document structure and its contents. Each node in the tree contains a Poppler.StructureElement.

Here is a simple example that walks the whole tree:

<informalexample><programlisting> static void walk_structure (Poppler.StructureElementIter *iter) { do { /<!– –>* Get the element and do something with it *<!– –>/ Poppler.StructureElementIter *child = Poppler.StructureElementIter.get_child (iter); if (child) walk_structure (child); Poppler.StructureElementIter.free (child); } while (Poppler.StructureElementIter.next (iter)); } … { iter = Poppler.StructureElementIter.new (document); walk_structure (iter); Poppler.StructureElementIter.free (iter); } </programlisting></informalexample>

New in version 0.26.

copy()
Returns:

a new Poppler.StructureElementIter

Return type:

Poppler.StructureElementIter

Creates a new Poppler.StructureElementIter as a copy of self. The returned value must be freed with Poppler.StructureElementIter.free().

New in version 0.26.

free()

Frees self.

New in version 0.26.

get_child()
Returns:

a new Poppler.StructureElementIter

Return type:

Poppler.StructureElementIter

Returns a new iterator to the children elements of the Poppler.StructureElement associated with iter. The returned value must be freed with Poppler.StructureElementIter.free().

New in version 0.26.

get_element()
Returns:

a new Poppler.StructureElementIter

Return type:

Poppler.StructureElement

Returns the Poppler.StructureElementIter associated with self.

New in version 0.26.

next()
Returns:

True, if self was set to the next structure element

Return type:

bool

Sets self to point to the next structure element at the current level of the tree, if valid. See Poppler.StructureElementIter.new() for more information.

New in version 0.26.