An outline iterator can be used to walk over all the items in an
Outline and query their properties. To be able to insert items at the
end of a list of sibling items, it can also walk one item past the end
of the list. To get an instance of OutlineIterator use Document.prototype.outlineIterator().
In the context of a PDF file, the document’s Outline is also known as Table of Contents or Bookmarks.
You cannot create instances of this class with the new operator!
OutlineIterator instances are returned by Document.prototype.outlineIterator().
Navigation return codes:
Movement was not possible.
New position has a valid item.
New position has no item, but one can be inserted here.
Style bit flags:
Bit is set outline item style is bold.
Bit is set if outline item style is italic.
Return a OutlineItem or
null if out of range.
var obj = outlineIterator.item()Move the iterator position to “next”. The return value is negative if
this movement is not possible, 0 if the new position has a
valid item, or 1 if the new position has no item but one
can be inserted here.
var result = outlineIterator.next()Move the iterator position to “previous”. The return value is
negative if this movement is not possible, 0 if the new
position has a valid item, or 1 if the new position has no
item but one can be inserted here.
var result = outlineIterator.prev()Move the iterator position “up”. The result value is negative if this
movement is not possible, 0 if the new position has a valid
item, or 1 if the new position has no item but one can be
inserted here.
var result = outlineIterator.up()Move the iterator position “down”. The return value is negative if
this movement is not possible, 0 if the new position has a
valid item, or 1 if the new position has no item but one
can be inserted here.
var result = outlineIterator.down()Insert item before the current item. The position does not change.
The return value is 0 if the current position has a valid
item, or 1 if the position has no valid item.
OutlineItem) – the
item to insertvar result = outlineIterator.insert(item)Delete the current item. This implicitly moves to the next item. The
return value is 0 if the new position has a valid item, or
1 if the position contains no valid item, but one may be
inserted at this position.
outlineIterator.delete()Updates the current item properties with values from the supplied item’s properties.
OutlineItem) – An
item populated with the properties that should be stored.outlineIterator.update(item)