Class: QgsPageSizeRegistry

class qgis.core.QgsPageSizeRegistry

Bases: sip.wrapper

A registry for known page sizes.

QgsPageSizeRegistry is not usually directly created, but rather accessed through QgsApplication.pageSizeRegistry().

New in version 3.0.

QgsPageSizeRegistry() Creates a registry and populates it with known sizes

QgsPageSizeRegistry(QgsPageSizeRegistry)

Methods

add

Adds a page size to the registry.

decodePageSize

Decodes a string representing a preset page size.

entries

Returns a list of page sizes in the registry.

find

Finds matching page sizes from the registry, using a case insensitive match on the page size name.

add(self, size: QgsPageSize)

Adds a page size to the registry.

Parameters

size (QgsPageSize) –

decodePageSize(self, string: str, size: QgsPageSize)bool

Decodes a string representing a preset page size. The decoded page size will be stored in the size argument.

Return type

bool

Returns

True if string was successfully decoded

Parameters
entries(self)List[QgsPageSize]

Returns a list of page sizes in the registry.

Return type

List[QgsPageSize]

find(self, name: str)List[QgsPageSize]

Finds matching page sizes from the registry, using a case insensitive match on the page size name.

find(self, size: QgsLayoutSize) -> str Finds a matching page size from the registry. Returns the page size name, or an empty string if no matching size could be found.

Orientation is ignored when matching page sizes, so a landscape A4 page will match to the portrait A4 size in the registry.

Parameters

name (str) –

Return type

List[QgsPageSize]