If the reality is as you have mentioned that you were given money to distribute it among the poor and the needy, then you were the deputy of the one who entrusted you with this task. You should have done what you have been entrusted with, which is distributing the money among the poor and the needy without having to know whether it was Zakah money or Sadaqah, for the intention of the benefactor is enough. As for
spending part of the money in printing some books and buying office furniture, this is a sort of transgression from which you should turn to Allah in repentance and ask for His Forgiveness. Even more, you should pay this sum from your own money and spend it in what you were entrusted with, that is, distribute it among the poor and the needy. In addition, it is not permissible for you to take anything from this money even if you are poor or needy unless you take the permission of the benefactor. Accordingly, you should pay what you took for yourself and give it to the poor. May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.