A QGIS plugin to export simultaneously multiple print layouts to various file formats
Even though multiple pages and atlas options have improved print layouts usability and help enough to create many maps with few print layouts in a project, you can still have many print layouts in your project. And when comes the time to print or export them, it is not as fun as it could be. You indeed need to open each print layout, wait till it renders, fill the export options, wait till the export finishes to open the next layout. And so on…
If you find this process long and somehow boring (and even if you do not), then Maps Printer plugin is designed for you. It offers an easy, simple and quicker way to export print layouts to pdf, svg or image (jpg, tif, png, bmp…) file format.
The easiest way to install Maps Printer plugin in QGIS is through
the Plugins --> Manage and Install plugins...
menu of QGIS.
When installed, Maps Printer adds to the Processing Toolbox a new Maps Printer
entry with following algorithms:
Export layouts from project
: exports a set of layouts from the current projectExport layouts from folder
: exports all the layouts from all the projects
files in a selected folderA Help
entry is also added to the top Help --> Plugins --> Maps Printer
menu
and opens this documentation.
From the Processing options dialog (Settings --> Options -->
Processing -->
), under Providers --> Maps Printer
, you can
select the default format you wish to use while exporting.
The list of available formats is based on the one supported by your OS.
Once you have created and set at your convenience your print layouts and wish to export some of them,
Expand the Maps Printer
entry in the Processing Toolbox
panel and double-click Export layouts from project
.
The following dialog opens.
The Export from Project algorithm dialog
...
next to the Layouts to export
field.Extension for exported maps
.
By default, its value is set to .png
format but you can configure it
(as explained below).Export resolution
to apply to all the outputs.
If not set, each layout is exported using its own set resolution....
button of Output folder of exported maps
to
browse your file explorer and select the output folderClick Run
to execute.
Maps will be output to the indicated folder. Check the log tab for issues, if any.
The Export layouts from folder
algorithm helps you export layouts
from projects in a folder.
Expand the Maps Printer
entry in the Processing Toolbox
panel and double-click Export layouts from folder
.
The following dialog opens.
The Export from Folder algorithm dialog
...
button of the Projects folder
field
and select the folder to use as inputInclude sub-directories
option if you want to also export
layouts from the subfolders of the input directorExtension for exported maps
.
By default, its value is set to .png
format but you can configure it
(as explained above).Export resolution
to apply to all the outputs.
If not set, each layout is exported using its own set resolution.Prefix with project file name
to minimize the risk;
exported layouts will will be placed following the project folder structure....
button of Output folder of exported maps
to
browse your file explorer and select the output folderClick Run
to execute.
QGIS will successively open each available project file and output their layouts’ maps.
Maps Printer’s algorithms can be run from the QGIS Python console:
# Display help, for algorithm parameters
>>> processing.algorithmHelp("mapsprinter:exportlayoutsfromproject")
# Export few layouts to PDF
>>> processing.run("mapsprinter:exportlayoutsfromproject",
{'LAYOUTS': [0,2],
'EXTENSION': 0,
'OUTPUT': '/path/to/exports/folder'
}
)
Starting from QGIS 3.14, it’s also possible to call Maps Printer’s algorithms and export layouts from the command line using qgis_process.
# Display help, for algorithm parameters
$ qgis_process help mapsprinter:exportlayoutsfromfolder
# Export layouts from project files within a folder and subfolders
$ qgis_process run mapsprinter:exportlayoutsfromfolder --PROJECTS_FOLDER=/path/to/projects/folder \
--RECURSIVE=1 --EXTENSION=0 --OUTPUT_FOLDER=/path/to/exports/folder
Plugin developped by Harrissou Sant-anna (CAUE 49) - 2021