pdfGetLayerName
Get the name of a layer.
char *pdfGetLayerName(PDFHandle pdf, PDFLayerHandle layer, int *length)
This function returns the name of a layer. The returned value is a
null-terminated string, and its length is also stored
in
*length
.
The layer argument is an opaque layer handle, returned by
pdfGetLayer
.
The layer name is converted according to the current text encoding (see
pdfSetTextEncoding
).
The caller is responsible for freeing the name string after using it,
by calling pdfFreeMemory
.
C:
int n, i, length;
PDFLayerHandle layer;
char *name;
n = pdfGetNumLayers(pdf);
for (i = 0; i < n; ++i) {
layer = pdfGetLayer(pdf, i);
name = pdfGetLayerName(pdf, layer, &length);
...
}