There is a difference between background layers which are part of
the QGIS project and background layers you configure in the themes
configuration. The approach should be:
- Background layers used in the viewer need to be defined in the
backgroundLayers section of the themes configuration, not in the
- If you want to have a background when printing, you can add an
equivalent layer to the QGIS project and specify it as
"printLayer" for the respective backgroundLayer in the themes
configuration. The idea behind this is that you can use a fast
WMTS for the viewer and an equivalent high-quality WMS for
printing. Layers in the QGIS project marked as printLayer in the
themes configuration are not added to the QWC2 layer tree.
Note that background layers added to the QGIS project which are
not marked as printLayer are treated as normal layers, since there
is no way to know whether a raster layer is a background layer or
So in short: define your background layers in the themesConfig,
remove them from the QGIS project, except for those you want to
use as print layers and mark as printLayer in the themesConfig.
Hope this helps
On 07.03.2017 13:40, Sascha Picard
first of all: Thanks for this awesome project!
I hope to find help in a comprehension question´:
I am currently playing around witth the sample app.
I set up a QGIS server that serves a QGS-Project that
contains some WMS layers as well as a couple of composer
When I use the print plugin in the adapted sample app, it
generates a corrupted PDF file.
I looked into the POST request formulated by qwc2\QWC2Components\Plugins\Print.jsx
that the query param LAYERS also contains the name of the
currently displayed background layer.
If I leave that name out of the request, my pdf gets