PageSize
- class plutoprint.PageSize(width: float = 0.0, height: float = 0.0)[source]
The PageSize class represents the dimensions of a page in points (1 / 72 inch).
- __init__(width: float = 0.0, height: float = 0.0) None[source]
Initializes a new instance of the PageSize class.
- Parameters:
width – The width of the page in points.
height – The height of the page in points.
- __getitem__(index: int) float[source]
Allows access to the dimensions of the page using an index.
- Parameters:
index – The index to access (0 for width, 1 for height).
- Returns:
The width if index is 0, the height if index is 1.
- Raises:
IndexError – If the index is out of range (not 0 or 1).
- landscape() PageSize[source]
Returns a PageSize instance with width and height swapped if the current orientation is portrait (width < height).
- Returns:
A PageSize instance with swapped dimensions if in portrait mode, otherwise the original dimensions.
- plutoprint.PAGE_SIZE_NONE: PageSize = Ellipsis
Represents a page size with zero dimensions on all sides.