Tuesday 22 May 2018

qgis - Export a configured Atlas with a Python script / command line?


I just want to export a configured Atlas (composer with Atlas option and cover layer enabled)


I tried this :


composerView = qgis.utils.iface.activeComposers()[0]
composition = composerView.composition()
atlas = composition.atlasComposition()
composition.setAtlasMode(QgsComposition.ExportAtlas)

atlas.beginRender()
for i in range(0,atlas.numFeatures()):

atlas.prepareForFeature(i)
composition.exportAsPDF('C:\xxxx\test.pdf' + str(format(i)))
atlas.endRender()

But nothing happens.


Have anybody a clue?




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...