<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Sascha</p>
    <p>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:</p>
    <p>- Background layers used in the viewer need to be defined in the
      backgroundLayers section of the themes configuration, not in the
      QGIS project.</p>
    <p>- 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.</p>
    <p>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
      something else.</p>
    <p>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.</p>
    <p>Hope this helps<br>
      Sandro</p>
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 07.03.2017 13:40, Sascha Picard
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAGTS_9trxaqmgFA1Vw8BV3U9u6SoNr1k0NbScEwk-7xDhJUVKw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hello,<br>
          <br>
        </div>
        <div>first of all: Thanks for this awesome project!<br>
        </div>
        <div>I hope to find help in a comprehension question´:<br>
        </div>
        <div><br>
        </div>
        <div>I am currently playing around witth the sample app.<br>
        </div>
        <div>I set up a QGIS server that serves a QGS-Project that
          contains some WMS layers as well as a couple of composer
          templates.<br>
          <br>
        </div>
        <div>When I use the print plugin in the adapted sample app, it
          generates a corrupted PDF file.<br>
        </div>
        <div>I looked into the POST request formulated by <i>qwc2\QWC2Components\Plugins\Print.jsx</i>
          and noticed,<br>
        </div>
        <div>that the query param LAYERS also contains the name of the
          currently displayed background layer.<br>
        </div>
        <div>If I leave that name out of the request, my pdf gets
          printed.<br>
          <br>
        </div>
        <div>I then noticed that the WMS example in the sample app also
          serves those backround layers (osm_grau, osm_hell etc.):<br>
             <a moz-do-not-send="true"
href="http://qwc2.sourcepole.ch/wms/wolfsburg/qwc2_demo?SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings">http://qwc2.sourcepole.ch/wms/wolfsburg/qwc2_demo?SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings</a><br>
          <br>
        </div>
        <div>Does that really mean that I have to add the background
          layers, which are used in the client, as services to the
          qgs-file served by QGIS-Server<br>
        </div>
        <div>– respectively always use a copy of a project binding these
          services as a base for the configuration of a theme in QGIS?
          That would be a bit inconvenient.<br>
        </div>
        <div>Or am I missing point here?</div>
        <div><br>
          <br>
        </div>
        <div>Regards<br>
        </div>
        <div>Sascha<br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
qgis-qwc2 mailing list
<a class="moz-txt-link-abbreviated" href="mailto:qgis-qwc2@lists.osgeo.org">qgis-qwc2@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-qwc2">https://lists.osgeo.org/mailman/listinfo/qgis-qwc2</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>