Re: [Qgis-user] Custom preset format page for print layouts

2022-01-02 Thread Thomas Gratier
Hi, Hope the following will be more understandable from a non-coder # Below tell you how many entries (QgsPageSize) are already present (A4, A3, ...) before print(len(pageSizeRegistry.entries())) # To inspect content of first entry (was useful to understand was is present in each QgsPageSize) pri

Re: [Qgis-user] Custom preset format page for print layouts

2022-01-02 Thread Christophe Besuchet
Hi Thomas, Thanks a bunch for your answer and your code. It works like a charm! However, I'm really bad at coding and I'm not sure why some lines are commented; since your code works without uncommenting these lines, can you tell me what's their purpose? Cheers, Golok > On 2 Jan 2022, at 18:

Re: [Qgis-user] Custom preset format page for print layouts

2022-01-02 Thread Thomas Gratier
Hi, In startup.py, add the following to register your custom Custom preset format page for print layouts. from qgis.core import QgsApplication, QgsPageSize, QgsLayoutSize, QgsUnitTypes pageSizeRegistry = QgsApplication.pageSizeRegistry() # For demo purpose in PyQGIS, so commented # print(len(p

[Qgis-user] Custom preset format page for print layouts

2021-12-29 Thread Christophe Besuchet
Hello all, I'm often using the same custom page size in my print layouts, and I created several templates for this. However, if I have to add a new page, the later won't inherit my template's format settings; the Size menu will only propose standard presets and I will have to set the size manu