Check to see if a layer display order node is a name.
int pdfGetLayerOrderIsName(PDFViewerHandle viewer, PDFLayerOrderHandle order)
PDF files with layers contain a tree structure that specifies the way layers are intended to be displayed to the user. Each node in the tree has either a name or a layer. Named nodes are used to provide a hierarchical structure for the layers, with labels to help the user. Each node also optionally has a list of child nodes.

This function returns a non-zero value if the specified layer order tree node has a name, and zero if the node contains a layer.

scanLayerOrder(pdfGetLayerOrderRoot(viewer)); ... void scanLayerOrder(PDFLayerOrderHandle order) { char *name; int length; PDFLayerHandle layer; int nChildren, i; if (pdfGetLayerOrderIsName(viewer, order)) { /* this node has a name */ name = pdfGetLayerOrderName(viewer, order, &length); ... pdfFreeMemory(name); } else { /* this node has a layer */ layer = pdfGetLayerOrderLayer(viewer, order); ... } nChildren = pdfGetLayerOrderNumChildren(viewer, order); for (i = 0; i < nChildren; ++i) { scanLayerOrder(pdfGetLayerOrderChild(viewer, order, i); } }