1

I have a QGis project that I programmatically modify using the Python xml.etree library. Now, I would like to know if it is possible to add few lines to my script in order to export the modified project to a new jpg image. The python script should be run OUTSIDE the QGis python console. Thanks!

Andreampa
  • 730
  • 6
  • 17

1 Answers1

1

You may use the printPageAsRaster (int page) function from the QgsComposition class

print composer page to image If the image does not fit into memory, a null image is returned More...

This Q/A gives an example of it exporting to png (which you can change to jpg).

Programmatically load composer from template and generate atlas using pyQgis

artwork21
  • 35,114
  • 8
  • 66
  • 134