[Qgis-user] Available sizes for QgsLayoutItemPage

Nyall Dawson nyall.dawson at gmail.com
Tue Feb 25 18:30:11 PST 2025


On Wed, 26 Feb 2025 at 11:57, afernandez via QGIS-User
<qgis-user at lists.osgeo.org> wrote:
>
> I was looking for the one with the highest aspect ratio, which is 1080 x 1920 px and seems to be working well for my purposes. Thank you for the help.

You can always add a custom size to the registry if you want!

QgsApplication.pageSizeRegistry().add(QgsPageSize('my page size',
QgsLayoutSize(101, 202, Qgis.LayoutUnit.Millimeters), 'My super
awesome page size'))

Nyall


>
> David Strip wrote:
>
>
> On 2/25/2025 10:26 AM, afernandez via QGIS-User wrote:
>
> This tells me that there're 32 preloaded pages but I still cannot see the properties such  as names (e.g. 'A4') or sizes (e.g. 3407 x 2480 pixels)
> Is there an easy way to retrieve more specific information? Thanks
>
>
> for entry in aaa.entries():
>     pprint.pprint(entry.size)
> <QgsLayoutSize: 105 x 148 mm >
> <QgsLayoutSize: 148 x 210 mm >
> <QgsLayoutSize: 210 x 297 mm >
> <QgsLayoutSize: 297 x 420 mm >
> <QgsLayoutSize: 420 x 594 mm >
> <QgsLayoutSize: 594 x 841 mm >
> <QgsLayoutSize: 841 x 1189 mm >
> <QgsLayoutSize: 125 x 176 mm >
> <QgsLayoutSize: 176 x 250 mm >
>
> for entry in aaa.entries():
>     pprint.pprint(entry.name)
> 'A6'
> 'A5'
> 'A4'
> 'A3'
> 'A2'
> 'A1'
> ....
>
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


More information about the QGIS-User mailing list