Revert "Fix ebook and pdf generator"

This reverts commit f43e630528be43d5aec4e6f923b0f53107f93546.