<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">Thanks Even,<br><br>>One thing to remind is that some layers are turned off by default in PDF. So <br clear="none">>defining GDAL_PDF_LAYERS_OFF "Grids" will turn off "grids", but will let layers <br clear="none">>that defaulted to OFF as OFF. So if you want all layers but "Grids", you need <br clear="none">>to specify --config GDAL_PDF_LAYERS "ALL" as well. When both are defined, <br clear="none">>GDAL_PDF_LAYERS_OFF will override GDAL_PDF_LAYERS.<br><div><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">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:</div><div style="color: rgb(0, 0, 0); font-size: 16px;
 font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">> $ gdal_translate.exe c:\world.pdf out.tif --config GDAL_PDF_LAYERS "ALL" --config GDAL_PDF_LAYERS_OFF "Grids"</div><br>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.<br><br>Has anyone else experienced this issue?  I would like to assist in verifying functionality of this feature.  What can I do to help out?<br><br>Robert<br><span></span><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif;
 background-color: transparent; font-style: normal;"><span><br></span></div><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Even Rouault <even.rouault@mines-paris.org><br> <b><span style="font-weight: bold;">To:</span></b> gdal-dev@lists.osgeo.org; Robert Zermeno <refriguy68@yahoo.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, October 7, 2013 3:50 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [gdal-dev] GDAL and GeoPDF with Poppler (Couple issues)<br> </font> </div> <div class="y_msg_container"><br>Le mardi 08 octobre 2013 00:26:45, Robert Zermeno a écrit :<br clear="none">> Ladies/Gents,<br clear="none">> <br clear="none">> I have been using
 GeoPDF capability with 0.16.3 for a while and enjoy the<br clear="none">> capabilities GDAL provides.  I have wanted to add the capability to turn<br clear="none">> Layers On/Off using the features provided.  Lets assume I have a file<br clear="none">> called world.pdf that contains more than 5 Layers with sub-layers.<br clear="none">> <br clear="none">> Project Configuration:<br clear="none">> <br clear="none">> GDAL_repos:  9-28-2013<br clear="none">> Poppler:         version 0.16.3<br clear="none">> OS:              Windows XP SP3<br clear="none">> Build:           MSVC 2008<br clear="none">> <br clear="none">> <br clear="none">> Once built with the configuration above, I used the technique provided in<br clear="none">> the frmt_pdf.html page using gdal_translate.exe to turn off 1 Layer:<br clear="none">> <br
 clear="none">> $ gdal_translate.exe c:\world.pdf out.tif --config GDAL_PDF_LAYERS_OFF<br clear="none">> "Grids"<br clear="none">> <br clear="none">> I assume I used the proper request to only turn off "Grids" and allow all<br clear="none">> other LAYERS "On". The problem I get is when it executes more layers are<br clear="none">> turned "off" than the single layer specified.<br clear="none">> <br clear="none">> Here are my issues:<br clear="none">> <br clear="none">> 1. How do I request to output a file that turns off one or more Layers and<br clear="none">> keeps the others on?<br clear="none">> 2. According to the frmt_pdf.html, under the Configuration Options,<br clear="none">> GDAL_PDF_LAYERS and GDAL_PDF_LAYERS_OFF both state "When this option is<br clear="none">> specified, layers not explicitly listed will be turned off". <br clear="none">> <br clear="none">>   I hope a quick copy & paste
 was performed... <br clear="none"><br clear="none">Yes copy & paste error. The comment "When this option is specified, layers not <br clear="none">explicitly listed will be turned off" only applies to GDAL_PDF_LAYERS<br clear="none"><br clear="none">One thing to remind is that some layers are turned off by default in PDF. So <br clear="none">defining GDAL_PDF_LAYERS_OFF "Grids" will turn off "grids", but will let layers <br clear="none">that defaulted to OFF as OFF. So if you want all layers but "Grids", you need <br clear="none">to specify --config GDAL_PDF_LAYERS "ALL" as well. When both are defined, <br clear="none">GDAL_PDF_LAYERS_OFF will override GDAL_PDF_LAYERS.<br clear="none"><br clear="none">> <br clear="none">> 3. When I executed gdal_translate.exefrom the request above, I got the<br clear="none">> following Error:<br clear="none">> <br clear="none">> ERROR 1: Could not find a OCG with Ref (13:0)<br clear="none">> ERROR
 1: Could not find a OCG with Ref (30:0)<br clear="none">> ...repeats with different Ref() numbers<br clear="none">> <br clear="none">> ERROR 1: Could not find a OCG with Ref (153:0)<br clear="none">> <br clear="none">> This is a known Poppler issue as you can see here:<br clear="none">> <a shape="rect" href="https://bugs.freedesktop.org/show_bug.cgi?id=39637" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=39637</a><br clear="none">> <br clear="none">> It states that the fix was added to Poppler version 0.17.2 >=<br clear="none">> If that is true, the documentation (frmt_pdf.html) should indicate that.  I<br clear="none">> do not know if that is why my generated file is not correct as I do not<br clear="none">> know what is effect by this recoverable error mentioned above.<br clear="none"><br clear="none">This is likely but impossible to be sure without verifying.<div class="yqt1817986228"
 id="yqtfd74339"><br clear="none"><br clear="none">> <br clear="none">> <br clear="none">> I have not added a ticket for GDAL before, where is the location I can add<br clear="none">> future bugs if they arise?</div><br clear="none"><br clear="none"><a shape="rect" href="http://trac.osgeo.org/gdal/newticket" target="_blank">http://trac.osgeo.org/gdal/newticket</a><br clear="none"><br clear="none">Even<br clear="none"><br clear="none">-- <br clear="none">Geospatial professional services<br clear="none"><a shape="rect" href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br><br></div> </div> </div>  </div></body></html>