This is a very simple thing to do I'll explain. There's also a tutorial image to follow
Measure your books while fully open. Measure the width and the height. Add a bout 5 inches to the width, let's call this width measurement plus the added inches, Measurement X+5. Let's call the height measurement Measurement Y.
Choose your needles and yarn, check your guage per 4x4 quare, and measure the amount of stitches you generally have in an inch. Multiply that by Measurement X+5 which equals the total number of stitches. Cast on that number, and knit until your peice's height matches the inches of Measurement Y.
When you are done, fold over half the number of inches that you added to the width, and sew them to the bigger part.
It might help to do 1x1 or 2x2 ribbing on the rectangle that you are knitting to make it fit more snugly to the book.