-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Description
When people use expressions, they sometimes do not find specific functions. You have to make some of them using Python expressions.
Although expressions can be already published, is there any way to also push Python expressions? I missed the functionality or not available?
Triggered by recurring questions on the QGIS users mailing list like https://lists.osgeo.org/pipermail/qgis-user/2021-May/048919.html
Should be possible using the following Python function
@qgsfunction(args='auto', group='Layout')
def get_page_format(layoutname, pagenumber, feature, parent, context):
layout = QgsProject.instance().layoutManager().layoutByName(layoutname)
page = layout.pageCollection().page(pagenumber - 1)
return QgsApplication.pageSizeRegistry().find(page.pageSize())kannes