Print dialog is using GTK API, so GTK must be initialized for it to work. In GetPrintHandler() it will be checked whether gdk display is available and if not GTK will be initialized automatically when print dialog is demanded.
Done in commit 77c506b.