The expression “by the book” is an English idiom that means to exactly follow the rules and regulations; to follow given directions explicitly, without deviation, or to act in an officially approved manner.
Some think the expression originally referred to the Bible, the well known book from ancient times. This certainly makes sense, as the God of the Bible required His people to exactly follow His commands.