How can I add custom paper sizes to the presets under the Composition tab?
If I save and reuse a template, only the Item properties are saved, not the Composition items, so I have to change the width and height of the paper every time.
How can I add custom paper sizes to the presets under the Composition tab?
If I save and reuse a template, only the Item properties are saved, not the Composition items, so I have to change the width and height of the paper every time.
The way I've done it in QGIS3 is via a simple python script that runs on QGIS startup. In the QGIS APPDATA folder (on Windows, this is found via Settings>User Profiles>Open Active Profile folder - then going back up to the QGIS/QGIS3 folder, or %appdata% -> QGIS/QGIS3)
Once you're there. Create a new file called startup.py (or edit the one there if there already is one), edit the file, and add in these lines:
from qgis.core import QgsApplication, QgsPageSize, QgsLayoutSize, QgsUnitTypes
pageSizeRegistry = QgsApplication.pageSizeRegistry()
and then add in the page sizes you want:
pageSizeRegistry.add(QgsPageSize('reportsmall', QgsLayoutSize( 146,245, units=QgsUnitTypes.LayoutMillimeters), 'Report - Small'))
Save it, open QGIS, and your new paper size should be there in the page size options.
You can add a bunch of other page sizes via this method.