<div dir="ltr">Hi Hugo,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 6, 2014 at 6:24 AM, Hugo Mercier <span dir="ltr"><<a href="mailto:hugo.mercier@oslandia.com" target="_blank">hugo.mercier@oslandia.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I am investigating how multilayer PDF export could be handled through QGIS.<br>
This is a feature of the PDF format (called Optional Content Groups)<br>
that would allow to keep "layered" representation of a GIS map when<br>
exported to a PDF.<br>
<br>
Something similar has been recently done with the SVG format (<br>
<a href="https://github.com/qgis/QGIS/pull/1092" target="_blank">https://github.com/qgis/QGIS/pull/1092</a>)<br>
<br>
As far as I know :<br>
- QPrinter/QPainter is not able to deal with this concept of layer<br>
- OGR/GDAL has a driver for Geospatial PDF writing that does support<br>
multi layers, but has a very limited support for styling, so it would<br>
require to rasterize each layer and put them into the PDF<br>
- only a few third-party PDF libraries support writing and OCG, probably<br>
poppler is the best option.<br>
<br>
Does anyone see other easier options ?<br></blockquote><div><br>What about generating individual PDF outputs for each 'layer' (i.e. a 
layer or group of layers in layer legend) first, then combining them 
into a PDF as layers?<br><br></div><div>This is totally untested, but when using GDAL to generate a geospatial, layered PDF, could the individual 'layer' PDF outputs be piped back into GDAL as DATASOURCEs for individual layers? There seems to be a set order for generating the layers, e.g. raster on bottom with vector layers over top, instead of random instertion, e.g. raster on bottom, then vector, then raster. You might want to ask Mr. Warmerdam about how flexible the PDF layer writing process is, and whether external PDF content can be streamed through to layered output (instead of having any geometries read and styled). There is the EXTRA_STREAM=content creation option, but I don't know if it can be used multiple times to insert external PDFs as layers.<br>
<br></div><div>Also, I think the blending modes of individual layers/groups would have to be migrated to PDF-specific (Postcript?) definitions, since each will be rendered separately. Surely standard blending modes for layers can be defined in PDFs (?).<br>
<br></div><div>I think this is a *very* important export feature to add to QGIS, and will ultimately help with its adoption in enterprise, institutional and government settings, since such an output fulfills many mandates for publicly releasing a functional representation of data.<br>
</div><div><br></div><div>Regards,<br><br></div><div>Larry<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks !<br>
<span class=""><font color="#888888">--<br>
Hugo Mercier<br>
Oslandia<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</font></span></blockquote></div><br></div></div></div>