[Qgis-developer] Multilayer PDF ?

Larry Shaffer larrys at dakotacarto.com
Thu Feb 6 10:31:23 PST 2014

Hi Hugo,

On Thu, Feb 6, 2014 at 6:24 AM, Hugo Mercier <hugo.mercier at oslandia.com>wrote:

> Hi,
> I am investigating how multilayer PDF export could be handled through QGIS.
> This is a feature of the PDF format (called Optional Content Groups)
> that would allow to keep "layered" representation of a GIS map when
> exported to a PDF.
> Something similar has been recently done with the SVG format (
> https://github.com/qgis/QGIS/pull/1092)
> As far as I know :
> - QPrinter/QPainter is not able to deal with this concept of layer
> - OGR/GDAL has a driver for Geospatial PDF writing that does support
> multi layers, but has a very limited support for styling, so it would
> require to rasterize each layer and put them into the PDF
> - only a few third-party PDF libraries support writing and OCG, probably
> poppler is the best option.
> Does anyone see other easier options ?

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?

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.

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 (?).

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.



> Thanks !
> --
> Hugo Mercier
> Oslandia
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140206/81a6c9ac/attachment.html>

More information about the Qgis-developer mailing list