Now the code considers the printer max height before going up 5 millimeters when restoring state. Besides, now this value is configurable via the registry.