pdfGetOutlineChild
Get an outline node child.
PDFOutlineHandle pdfGetOutlineChild(PDFViewerHandle viewer, PDFOutlineHandle outline, int idx)
This function returns the
idx
th child of the
specified outline tree node. idx
must be between 0 and
n-1, where n is the value returned by pdfGetOutlineNumChildren
.
Pass NULL as the outline
argument to specify the root
node, i.e., to get the top-level outline entries.
C:
/* start out at the root node */
scanOutline(NULL);
...
void scanOutline(PDFOutlineHandle outline) {
int n, i;
if (outline) {
/* do something with this outline entry */
} else {
/* this is the root node, which isn't a real entry -
* it has no title or target */
}
/* now scan the children of this node (if any) */
n = pdfGetOutlineNumChildren(viewer, outline);
for (i = 0; i < n; ++i) {
scanOutline(pdfGetOutlineChild(viewer, outline, i));
}
}