PDF printing race condition fix