Expression painter:printer() returns the Qt object of class qt.QtLuaPrinter underlying the painter if it is associated with a printer object. Otherwise returns nil.
painter:printer()
qt.QtLuaPrinter
nil