Wednesday, 6 September 2017

How to set up QGIS print composer options from the python console?


If I have a print composer called "ABC", I would like to "tell" its composer that I would like to



  1. update "Map 0" to simulate the "set to map canvas extent" button activation

  2. update certain text labels

  3. activate "export to image"


Thank you.



Answer




On the topic of print output from pyQGIS: http://www.qgis.org/pyqgis-cookbook/composer.html (Note: master has QgsComposition::loadFromTemplate method, which 1.8 has not).


Basically, in 1.8, you have to create the composition (with map, labels, etc.) from scratch in code anyway. So no updates are needed.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...