The second of the Five Precepts (pañca-sila) is “Adinnadana veramani sikkhapadam samadiyami”… meaning…. I undertake the precept to refrain from taking that which is not given. Overall, the precepts offer a clear moral foundation which has benefits for how we interact with others and our own spiritual progress. When one develops a strong conviction that the sacrifices one might have to make in observing the precepts that are really worth making, that there are some things of greater value to be gained by letting go of those unskillful activities, such thought / doubts come up at times. But here in this instance I do not see anything wrong in what you did.
The question is how can I explain this to you, to one who have decided that you’re not going to kill under any circumstances, that you’re not going to steal under any circumstances from anyone at all, no illicit sex, no lying, no intoxicants ever at all. When you give such limitless protection to all beings in following the precepts to the letter, then you gain a share in that limitless protection as well. Taking what is not given [stealing] is breaking a precept. A disciple of the noble ones abstains from taking what is not given. But when it comes to the True Teachings of the Buddha there is no such thing as stealing. Also there is no such thing as plagiarism, or plagiarizing when it comes to dhamma. No one can take ownership of the teachings of the Buddha.
But there is a serious problem, and a grave danger to those who speak of and write about Dhamma. It is of the distortion of the Suddamma. Today many a writers make gross distortions and incorrect adaptation of the Teaching of the Buddha to 'explain' the Dhamma. Thus it is very difficult for you and I to learn the true Dhamma without any adulterations or distortions that are widespread in most of today’s preaching and in the written material found in book stores and libraries. So in going forward in this dhamma path you and I have to be a bit cautious.