Praise be to Allah, The Lord of the Worlds.
Zakah on articles of merchandise is due on whatever is intended for trade, be it amongst the Zakatable items of wealth, such as grains, or the non- Zakatable, such as drapery, be it unsold, on sale, or stocked in warehouses. The evidence on this is that Allah The Almighty Says (What means): "O ye who believe! Spend of the good things which ye have earned, and of that which We bring forth from the earth for you…"{Al-Baqarah, 267}. According to scholars, "good things" refers to items of trade. Mujahid added: "it refers to lawful trade". Kindly refer to [Tafseer At-Tabarie, 2/556.]
Keeping an item with the intention of selling it is what makes Zakah an obligation. Kindly refer to "Moghni al-Mohtaaj, 2/106." Thus, printing a book to earn money makes it an item of merchandise.
In conclusion, if the above books are intended for trade then Zakah must be paid on their value, even if they weren`t sold. This is of course after one full lunar passes over their possession and their value reaches Nisab (Minimum amount liable for Zakah).
However, if these books were owned by the state or printed at its expense (The Ministry of Culture as an example), were distributed for free or sold and their value is deposited in the public treasury then they aren`t liable for Zakah. This is because they are amongst the public benefits and funds. And Allah The Almighty knows best.