For a scientific project I am trying to create a set of PDFs in QGIS with a fix layout (in the print composer) but per PDF a) different map item attributes (extents) and b) a QR-code to identify this PDF. The QR-Codes are already created with a python module (-> .svg) and the extents of the map items are a simple raster. The map content is a WMS which is embedded in the QGIS project.

My idea is to open a pre-defined print composer, iterate through the raster (has simple coordinates) and generate a PDF per iteration with the actual a) map layout and b) QR-code.

I am working with QGIS 2.12.1 (uses Pyton 2.7.5)

  • When you say "iterate through the raster", do you mean pan/zoom to different areas of it in the composer?
    – artwork21
    Commented Dec 3, 2015 at 12:59
  • We've done similar bulk print to pdf for the selected features in SurveyingCalculation plugin. It is available in the QGIS plugin repository. See batch plotting.py and batch_plotting_dialog.py
    – Zoltan
    Commented Dec 4, 2015 at 0:18
  • Right, I mean to pan to different areas. And I will have a look at this plugin, thanks!
    – Marco
    Commented Dec 6, 2015 at 9:43

1 Answer 1


Finally I created the PDFs with the atlas plugin in the print composer of QGIS. In the atlas configuration I set my shapefile as covering layer and used a dynamic expression for the filename like

'Map_'|| x_min(@atlas_geometry) || '_' || y_min(@atlas_geometry) || '_' || "SCALE"

The QR-Codes I generated before are shown as an image with an also dynamic expression, in this form

to_string( 'C:\\......\\' || x_min( @atlas_geometry ) || '_'|| y_min( @atlas_geometry ) || '_5000.svg')

for the scale 1:5000. Both worked pretty fine and took its time (about 3 days for the 20'000 maps). Actually my problem is: The printed WMS data (especially the fonts) are too small, the output (PDF or image) doesn't look like the preview in the print composer (see 2 screenshots). I just used the "export to pdf" function without chaning any settings. How can I get the output scaled like in the preview? output preview

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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