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

Robert Zermeno refriguy68 at yahoo.com
Tue Oct 8 10:09:05 PDT 2013


Thanks Even,

>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.


That logic makes sense to me...I will have to say as I integrated to the newer version of Poppler I noticed that for the command:

> $ gdal_translate.exe c:\world.pdf out.tif --config GDAL_PDF_LAYERS "ALL" --config GDAL_PDF_LAYERS_OFF "Grids"
I had success generating the proper image for Poppler v0.24.2 (latest release), but when I used "KDE for Windows" poppler build v0.22.3 I am not able to reproduce the same output.  Rather, many layers were missing.  Nothing was changed to the PDF file used on both execution.

Has anyone else experienced this issue?  I would like to assist in verifying functionality of this feature.  What can I do to help out?

Robert




________________________________
 From: Even Rouault <even.rouault at mines-paris.org>
To: gdal-dev at lists.osgeo.org; Robert Zermeno <refriguy68 at yahoo.com> 
Sent: Monday, October 7, 2013 3:50 PM
Subject: Re: [gdal-dev] GDAL and GeoPDF with Poppler (Couple issues)
 

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20131008/f99ed74d/attachment.html>


More information about the gdal-dev mailing list