Fixed pdf logic for lack of xserver