gdal driver pdf list-layer

Added in version 3.11.

Return the list of layers of a PDF file.

Synopsis

Usage: gdal driver pdf list-layers [OPTIONS] <INPUT>

List layers of a PDF dataset

Positional arguments:
  -i, --input <INPUT>                                  Input raster or vector dataset [required]

Common Options:
  -h, --help                                           Display help message and exit
  --json-usage                                         Display usage as JSON document and exit
  --config <KEY>=<VALUE>                               Configuration option [may be repeated]

Options:
  -f, --of, --format, --output-format <OUTPUT-FORMAT>  Output format. OUTPUT-FORMAT=json|text (default: json)

Description

Return the list of layers of a PDF file, as a JSON array or a text list.

Examples

Example 1: Return the list of layers of a PDF file as a JSON array

gdal driver pdf list-layers autotest/gdrivers/data/pdf/adobe_style_geospatial.pdf

returns:

[
  "New_Data_Frame",
  "New_Data_Frame.Graticule",
  "Layers",
  "Layers.Measured_Grid",
  "Layers.Graticule"
]

Example 2: Return the list of layers of a PDF file as as a text list

gdal driver pdf list-layers --of=text autotest/gdrivers/data/pdf/adobe_style_geospatial.pdf

returns:

New_Data_Frame
New_Data_Frame.Graticule
Layers
Layers.Measured_Grid
Layers.Graticule