Automatic printer detection