I am trying to build multiple print composers but most of the sheets that I have to work with use the same layers with an exception to one unique layer. Is it possible to create one map document with all the layers I need and then distribute the layers to various print composers that I specify in code?

I think I am creating way too many map documents when I can just create one and a python script would automatically set up print composers that corresponds to a standard I specify. I am new to the qgis library for python. Is there any base code I can work off of or any useful links that I should see?

1 Answer 1


You can check out those links.

QGIS export composer as pdf in python

Saving Map Canvas as PNG with transparent background programmatically with QGIS?

How to programmatically export a composition as image?

How to fill composer map with canvas data and export composition as png using Python script in QGIS

I am also stuck on how to create a map composer, add layers and legend to it and then output it (in pdf). Tell if you find out !

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.