[gdal-dev] GDAL and GeoPDF with Poppler (Couple issues)

Even Rouault even.rouault at mines-paris.org
Mon Oct 7 15:50:47 PDT 2013


Le mardi 08 octobre 2013 00:26:45, Robert Zermeno a écrit :
> Ladies/Gents,
> 
> I have been using GeoPDF capability with 0.16.3 for a while and enjoy the
> capabilities GDAL provides.  I have wanted to add the capability to turn
> Layers On/Off using the features provided.  Lets assume I have a file
> called world.pdf that contains more than 5 Layers with sub-layers.
> 
> Project Configuration:
> 
> GDAL_repos:  9-28-2013
> Poppler:         version 0.16.3
> OS:              Windows XP SP3
> Build:           MSVC 2008
> 
> 
> Once built with the configuration above, I used the technique provided in
> the frmt_pdf.html page using gdal_translate.exe to turn off 1 Layer:
> 
> $ gdal_translate.exe c:\world.pdf out.tif --config GDAL_PDF_LAYERS_OFF
> "Grids"
> 
> I assume I used the proper request to only turn off "Grids" and allow all
> other LAYERS "On". The problem I get is when it executes more layers are
> turned "off" than the single layer specified.
> 
> Here are my issues:
> 
> 1. How do I request to output a file that turns off one or more Layers and
> keeps the others on?
> 2. According to the frmt_pdf.html, under the Configuration Options,
> GDAL_PDF_LAYERS and GDAL_PDF_LAYERS_OFF both state "When this option is
> specified, layers not explicitly listed will be turned off". 
> 
>   I hope a quick copy & paste was performed... 

Yes copy & paste error. The comment "When this option is specified, layers not 
explicitly listed will be turned off" only applies to GDAL_PDF_LAYERS

One thing to remind is that some layers are turned off by default in PDF. So 
defining GDAL_PDF_LAYERS_OFF "Grids" will turn off "grids", but will let layers 
that defaulted to OFF as OFF. So if you want all layers but "Grids", you need 
to specify --config GDAL_PDF_LAYERS "ALL" as well. When both are defined, 
GDAL_PDF_LAYERS_OFF will override GDAL_PDF_LAYERS.

> 
> 3. When I executed gdal_translate.exefrom the request above, I got the
> following Error:
> 
> ERROR 1: Could not find a OCG with Ref (13:0)
> ERROR 1: Could not find a OCG with Ref (30:0)
> ...repeats with different Ref() numbers
> 
> ERROR 1: Could not find a OCG with Ref (153:0)
> 
> This is a known Poppler issue as you can see here:
> https://bugs.freedesktop.org/show_bug.cgi?id=39637
> 
> It states that the fix was added to Poppler version 0.17.2 >=
> If that is true, the documentation (frmt_pdf.html) should indicate that.  I
> do not know if that is why my generated file is not correct as I do not
> know what is effect by this recoverable error mentioned above.

This is likely but impossible to be sure without verifying.

> 
> 
> I have not added a ticket for GDAL before, where is the location I can add
> future bugs if they arise?

http://trac.osgeo.org/gdal/newticket

Even

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list