[Qgis-developer] Export atlas composition in python console to a single PDF file

Nyall Dawson nyall.dawson at gmail.com
Mon Aug 11 20:53:41 PDT 2014


On 11 August 2014 08:47, Junior Delaz <delazj at gmail.com> wrote:
> Hi All,
>
> A couple of hours I'm trying without success to do something so I ask for
> your help.
> I would like to export as PDF (in a single file) an atlas composition within
> Python Console.
> I don't find how to do.
> All I obtain is either multiple PDF files corresponding to each iterated
> feature of the coverage layer or a single feature corresponding to the last
> iterated feature.
> Where should I look at, please?
> And more generally, where can I find the code used by a tool such as "Export
> Atlas to PDF file" in the composer GUI (atlas menu)?

Unfortunately this code isn't currently exposed to the python
bindings, so can't be accessed via the console. The c++ code you are
looking for is in QgsComposer::exportCompositionAsPDF - at the moment
you'd need to reimplement this yourself in python. It's far from
ideal, and is on my list of things to fix, but I haven't found the
time to tackle this yet.

Nyall


More information about the Qgis-developer mailing list