My code is as follows:
from osgeo import ogr from osgeo import gdal dso = ogr.Open('myfile.pdf') print dso dsg = gdal.Open('myfile.pdf') print dsg driverGeoPDFogr = ogr.GetDriverByName('PDF') dso2 = driverGeoPDFogr.Open('myfile.pdf') print dso2
This results in:
None ERROR 4: `myfile.pdf' not recognised as a supported file format. None None
I know the file is a valid file, and when running gdalinfo from command line, the result for driver is:
Driver: PDF/Geospatial PDF
My question is, is PDF the incorrect driver name here for Geospatial PDF, or is this file format incompatible here? I'm running Python 2.6 and GDAL 1.11.2. Note, this is a Geospatial PDF, NOT a GeoPDF.