Adding onClose events and print functionality.

Signed-off-by: JerinJ <jerinj@cybage.com>