Carl,

I don't have one such PDF at hand, but with one sample of the GDAL autotest suite:

$ gdalinfo autotest/gdrivers/data/pdf/adobe_style_geospatial.pdf -mdd LAYERS
[...]
Metadata (LAYERS):
  LAYER_00_NAME=New_Data_Frame
  LAYER_01_NAME=New_Data_Frame.Graticule
  LAYER_02_NAME=Layers
  LAYER_03_NAME=Layers.Measured_Grid
  LAYER_04_NAME=Layers.Graticule
[...]

Programatically, you can get this list of layers with Dataset.GetMetadata("LAYERS")

Then you can select layers you want to activate with the LAYERS open option:

gdal_translate autotest/gdrivers/data/pdf/adobe_style_geospatial.pdf out.tif -oo LAYERS=New_Data_Frame.Graticule,Layers.Graticule

or disable select ones with the LAYERS_OFF open option:

gdal_translate autotest/gdrivers/data/pdf/adobe_style_geospatial.pdf out.tif -oo LAYERS_OFF=New_Data_Frame.Graticule,Layers.Graticule

Programatically,

gdal.Translate("out.tif", gdal.OpenEx("in.pdf", open_options = ["LAYERS=New_Data_Frame.Graticule,Layers.Graticule"])

Even

Le 25/03/2025 à 21:40, Carl Carlson via gdal-dev a écrit :

I have almost no experience with GDAL or python, butI do have  57 years programming experience.  I need some help with GDAL.  At 79 I don’t have the time and energy to get deeply into these topics.  I need a quick solution


I am writing a program to copy selected layers from a 7.5’ USGS geospatial PDF Topo File and save them as geoTIFFs.  My efforts with gdalinfo,  gdal.Open, and gdal.Translate have led me nowhere worthwhile.  I can’t find the layers.  I just don’t know enough about this.


Would some kind person help me out with sample code?


Thanks


_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

--
http://www.spatialys.com
My software is free, but my time generally not.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to