Poppler.IndexIter

Fields

None

Methods

class

new (document)

copy ()

free ()

get_action ()

get_child ()

is_open ()

next ()

Details

class Poppler.IndexIter
classmethod new(document)
Parameters:

document (Poppler.Document) – a Poppler.Document

Returns:

a new Poppler.IndexIter

Return type:

Poppler.IndexIter

Returns the root Poppler.IndexIter for document, or None. This must be freed with Poppler.IndexIter.free().

Certain documents have an index associated with them. This index can be used to help the user navigate the document, and is similar to a table of contents. Each node in the index will contain a Poppler.Action that can be displayed to the user &mdash; typically a Poppler.ActionType.GOTO_DEST or a Poppler.ActionType.URI<!– –>.

Here is a simple example of some code that walks the full index:

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

copy()
Returns:

a new Poppler.IndexIter

Return type:

Poppler.IndexIter

Creates a new Poppler.IndexIter as a copy of self. This must be freed with Poppler.IndexIter.free().

free()

Frees self.

get_action()
Returns:

a new Poppler.Action

Return type:

Poppler.Action

Returns the Poppler.Action associated with self. It must be freed with Poppler.Action.free().

get_child()
Returns:

a new Poppler.IndexIter

Return type:

Poppler.IndexIter

Returns a newly created child of self, or None if the iter has no child. See Poppler.IndexIter.new() for more information on this function.

is_open()
Returns:

True, if the document wants self to be expanded

Return type:

bool

Returns whether this node should be expanded by default to the user. The document can provide a hint as to how the document’s index should be expanded initially.

next()
Returns:

True, if self was set to the next action

Return type:

bool

Sets self to point to the next action at the current level, if valid. See Poppler.IndexIter.new() for more information.