1

I am using QGIS-server (2.14) for publishing online maps and everything seems to work fine except for the output of the GetPrint request.

Indeed, only the scale, the title and the label of the legend is displayed but not the map realized in the print composer (QGIS 2.14).

In the GetProjectSettings response, I have my print templates but the URL that I use (based on the QGIS documentation and tested under Chrome and Firefox):

http://myserver.com/cgi/qgis_mapserv.fcgi?...&REQUEST=GetPrint&TEMPLATE=myprintcomposername&map0:EXTENT=xmin,ymin,xmax,ymax&FORMAT=pdf&DPI=300&

Didn't display my layers/map cf.

enter image description here

Do you have any idea to fix the problem?

  • Perhaps there is a maximum width/height limit on the server. Printing needs better resolution than screen and therefore the preview can work even printing does not. From docs.qgis.org/testing/en/docs/user_manual/working_with_ogc/…: you can restrict the maximum size of the maps returned by the GetMap request by entering the maximum width and height into the respective fields under Maximums for GetMap request. – user30184 Jun 13 '17 at 13:54
  • Thanks for your comment, I tried it but it doesn't change anything. I have the same result. – Maëlle Jun 13 '17 at 14:05
  • A further test could be to make the same request with &DPI=72. If result is still the same there is obviously something else going on. – user30184 Jun 13 '17 at 14:12
  • Yes, it is the same. I already tried that :-( – Maëlle Jun 13 '17 at 14:15
  • Have you tried other formats than pdf? – user30184 Jun 13 '17 at 14:22
2

The problem is that your layers are not defined in the request therefore you need to add their names to the request, so the composer will display them.

mysrvr/qgis_mapserv.fcgi?map=myproject.qgs&SERVICE=WMS&VERSION=1.3&REQUEST=GetPrint&FORMAT=pdf&EXCEPTIONS=application/vnd.ogc.se_inimage&TRANSPARENT=true&SRS=EPSG:XXXX&DPI=300&TEMPLATE=TemplateName&map0:extent=12345.6,12345.3,45678.3,12345.7&map0:rotation=0&map0:scale=75000&map0:grid_interval_x=5000&map0:grid_interval_y=5000&LAYERS=Layer1%2CLayer2%2CLayer3%2CLayerN

Also note that the %2C is the separator between the layers.

  • We can also put the project name if we want all the layers. – Maëlle Jun 14 '17 at 22:31
  • 1
    Oh I didn't know that. Please accept the answer if it helped you solve your question. – Piskr Jun 15 '17 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.