I have a QGIS project with multiple layouts maps and all are configured by Atlas, I want to export to PDF all pages from Atlas in a single PDF. My code exports each page from each layout in a different PDF and after that I need to merge the PDFs for each layout. Is there some way solve this? I using QGIS 3.28
layouts_list = QgsProject.instance().layoutManager().printLayouts()
print("Encontrou", str(len(layouts_list)), "layouts")
for layout in layouts_list:
my_atlas = layout.atlas()
my_atlas.beginRender()
while my_atlas.next():
name = my_atlas.currentFilename()+ ' - FOLHA ' + str(my_atlas.currentFeatureNumber())
print('Imprime', name)
atlas_layout = my_atlas.layout()
print("set atlas")
exporter = QgsLayoutExporter(atlas_layout)
print("set exporter")
exporter.exportToPdf(destFolder + '/' + name + '.pdf', exporter.PdfExportSettings())