DelazJ / MapsPrinter

A QGIS plugin to export simultaneously multiple print layouts to various file formats
GNU General Public License v3.0
23 stars 6 forks source link

Atlas export to PDF creates multiple files when export to single file is selected #44

Closed nicogodet closed 2 years ago

nicogodet commented 3 years ago

Describe the bug

image image

Version de QGIS : 3.20.1-Odense Révision du code : 1c3c5cd6 Version de Qt : 5.15.2 Version de Python : 3.9.5 Version de GDAL : 3.3.1 Version de GEOS : 3.9.1-CAPI-1.14.2 Version de Proj : Rel. 8.1.0, July 1st, 2021 Version de PDAL : 2.3.0 (git-version: eac774) Traitement de l'algorithme… Démarrage de l'algorithme 'Export des mises en page du projet'… Paramètres en entrée: { 'EXTENSION' : 0, 'LAYOUTS' : [1], 'OUTPUT' : 'T:\21F0\1_RAPPORTS', 'RESOLUTION' : 150 }

Export de la mise en page 'Q10 - hauteur' en cours Mise en page exportée! Export terminé! Execution completed in 14.74 secondes Résultats : {'EXPORTEDLAYOUTS': 1, 'OUTPUT': 'T:\21F0\1_RAPPORTS'}

Chargement des couches de résultat Algorithme 'Export des mises en page du projet' terminé

I could create a small project to reproduce if you want.

nicogodet commented 3 years ago

By default, export to single file is checked but the custom property 'singleFile' does not exist.

cView.customProperty('singleFile') returns : True, False or None (and not 'true', 'false' or None)

https://github.com/DelazJ/MapsPrinter/blob/f32a81e9580b6ab3b34b8e5d4d3cd47301650df7/MapsPrinter/processor.py#L108

Should be

if cView.customProperty('singleFile') in [None, True] and extension == '.pdf':

Tested OK locally