StructureElementIter


Description:

[ CCode ( has_construct_function = false ) ]
[ Version ( since = "0.26" ) ]
public StructureElementIter (Document poppler_document)

Returns the root StructureElementIter for document, or null.

The returned value must be freed with free.

Documents may have an associated structure tree &mdashmostly, 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 StructureElement.

Here is a simple example that walks the whole tree:

static void
walk_structure (PopplerStructureElementIter *iter)
{
do {
/* Get the element and do something with it */
PopplerStructureElementIter *child = poppler_structure_element_iter_get_child (iter);
if (child)
walk_structure (child);
poppler_structure_element_iter_free (child);
} while (poppler_structure_element_iter_next (iter));
}
...
{
iter = poppler_structure_element_iter_new (document);
walk_structure (iter);
poppler_structure_element_iter_free (iter);
}

Parameters:

poppler_document

a Document.

Returns:

a new StructureElementIter, or null if document doesn't have structure tree.




2022 vala-language.org