Opened 10 years ago

Closed 10 years ago

#4695 closed defect (fixed)

PDF Driver fails to recognize a sample produced by "pdflib"

Reported by: mrosen Owned by: Even Rouault
Priority: normal Milestone: 1.10.0
Component: GDAL_Raster Version: 1.9.0
Severity: normal Keywords:
Cc:

Description

I've got GDAL 1.9.0 with Evan's PDF Driver. Works OK for many files, but not this one produced by the library at http://www.pdflib.com. I will attempt to attach it (924Kb)

Acrobat v9 displays Lat and Long correctly for this. However, GDAL fails to recognize this as a GeoSpatial PDF file.

c:\dev\main>xt_lib_gdal\dist\win32-vs10\Debug\pro\bin\gdalinfo c:\images\PDF\pdflib_starter_geospatial.pdf
Driver: PDF/Geospatial PDF
Files: c:\images\PDF\pdflib_starter_geospatial.pdf
Size is 2479, 3508
Coordinate System is `'
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 3508.0)
Upper Right ( 2479.0,    0.0)
Lower Right ( 2479.0, 3508.0)
Center      ( 1239.5, 1754.0)
Band 1 Block=2479x1 Type=Byte, ColorInterp=Red
Band 2 Block=2479x1 Type=Byte, ColorInterp=Green
Band 3 Block=2479x1 Type=Byte, ColorInterp=Blue

This is not an issue for us now.

Attachments (1)

pdflib_starter_geospatial.pdf (902.6 KB ) - added by mrosen 10 years ago.
Geospatial PDF file from pdflib that is recognized by Adobe but not GDAL

Download all attachments as: .zip

Change History (4)

by mrosen, 10 years ago

Geospatial PDF file from pdflib that is recognized by Adobe but not GDAL

comment:1 by Even Rouault, 10 years ago

Owner: changed from warmerdam to Even Rouault

Hum, to my understanding, the way they add the georeferencing information is not conformant with the "Acrobat Supplement to the ISO 32000" specification and paragraph 8.8 "Measurement properties" of the "PDF Reference, version 1.7" specification, which only mention the existence of the Measure object as a child of a VP (ViewPort) object. Whereas in the attached sample, the Measure object is a child of a Image object.

I'll try to see if it is possible to use it in that context, but it is non trivial, since it requires to parse the content stream of the page, so as to figure out where the image is drawn in the page.

comment:2 by Even Rouault, 10 years ago

I stand corrected actually. http://www.pdflib.com/pcos-cookbook/interactive-elements/geospatial/ mentions that there are actually 3 ways of attaching the Measure in an adobe-style georeferenced PDF. And the way used for that sample is indeed mentionned in "4.8.4 Image Dictionaries" of "Adobe® Supplement to the ISO 32000 BaseVersion: 1.7 ExtensionLevel: 3"

comment:3 by Even Rouault, 10 years ago

Component: defaultGDAL_Raster
Milestone: 2.0.0
Resolution: fixed
Status: newclosed

r24547 /trunk/ (4 files in 2 dirs): PDF: Recognized ISO georeferencing set at the image level (and not at the page level); expose such images as subdatasets (#4695)

$ gdalinfo pdflib_starter_geospatial.pdf
Driver: PDF/Geospatial PDF
Files: pdflib_starter_geospatial.pdf
Size is 1239, 1754
Coordinate System is `'
Metadata:
  CREATION_DATE=D:20120203111733-08'00'
  CREATOR=PDFlib starter sample
  PRODUCER=PDFlib Personalization Server 8.0.4 (C++/Win32) unlicensed
  TITLE=starter_geospatial
Subdatasets:
  SUBDATASET_1_NAME=PDF_IMAGE:1:6:pdflib_starter_geospatial.pdf
  SUBDATASET_1_DESC=Georeferenced image of size 1176x1057 of page 1 of pdflib_starter_geospatial.pdf
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1754.0)
Upper Right ( 1239.0,    0.0)
Lower Right ( 1239.0, 1754.0)
Center      (  619.5,  877.0)
Band 1 Block=1239x1 Type=Byte, ColorInterp=Red
Band 2 Block=1239x1 Type=Byte, ColorInterp=Green
Band 3 Block=1239x1 Type=Byte, ColorInterp=Blue
$ gdalinfo PDF_IMAGE:1:6:pdflib_starter_geospatial.pdf
Driver: PDF/Geospatial PDF
Files: none associated
Size is 1176, 1057
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563]],
    PRIMEM["Greenwich",0.0],
    UNIT["Degree",0.01745329251994328]]
Origin = (11.565000000000001,48.144999999999996)
Pixel Size = (0.000021258503401,-0.000014191106906)
Metadata:
  CREATION_DATE=D:20120203111733-08'00'
  CREATOR=PDFlib starter sample
  PRODUCER=PDFlib Personalization Server 8.0.4 (C++/Win32) unlicensed
  TITLE=starter_geospatial
Corner Coordinates:
Upper Left  (  11.5650000,  48.1450000) ( 11d33'54.00"E, 48d 8'42.00"N)
Lower Left  (  11.5650000,  48.1300000) ( 11d33'54.00"E, 48d 7'48.00"N)
Upper Right (  11.5900000,  48.1450000) ( 11d35'24.00"E, 48d 8'42.00"N)
Lower Right (  11.5900000,  48.1300000) ( 11d35'24.00"E, 48d 7'48.00"N)
Center      (  11.5775000,  48.1375000) ( 11d34'39.00"E, 48d 8'15.00"N)
Band 1 Block=1176x1 Type=Byte, ColorInterp=Red
Band 2 Block=1176x1 Type=Byte, ColorInterp=Green
Band 3 Block=1176x1 Type=Byte, ColorInterp=Blue
Note: See TracTickets for help on using tickets.