Expression painter.height returns the height of the drawing surface expressed in pixels. The returned value is not affected by the current transformation matrix. It corresponds to the default coordinate system set by painter:initmatrix.
painter.height
painter:initmatrix