Exporting multipages Atlas with predefined layout in one PDF file in QGIS 3.x I want to get a PDF export of my atlas in only one PDF File in QGIS 3.16. I've written the below code so far with the help of this previously answered question: PyQGIS control creation Atlas Layout
iface.addProject(myAtlasProject) project = QgsProject.instance() project.read(myAtlasProject) manager = project.layoutManager() layoutName = "Layout1" layout = manager.layoutByName(layoutName) for comp in manager.printLayouts(): comp.atlas().beginRender() comp.atlas().first() for i in range(0, comp.atlas().count()): settingspdf = QgsLayoutExporter.PdfExportSettings() exporter = QgsLayoutExporter(comp.atlas().layout () ) comp.atlas().next() exporter.exportToPdf("c:/temp/"+comp.atlas().currentFilename()+".pdf", settingspdf) comp.atlas().endRender()
Now the problem is that I get separate pages each time. However I want a single PDF export that contains all the pages. Can somebody help me with that?