A book is not a one-time pad, because the text is not random.

Nevertheless, using text extracted from a book for scrambling the message has one of the two characteristics of the one-time pad, it is non-periodic.

Such a substitution cipher with a non-periodic key was called a running-key cipher and it is the precursor of the one-time pad.

Running-key ciphers had been used starting from the second half of the 19th century up to the end of the first World War.

Until the end of WWI, everybody believed that it is impossible to decipher any message encrypted with a running key (i.e. non-periodic key). This belief has been proven to be false by William F. Friedman, who has succeeded in 1918, during the final months of the war, to decipher some messages that had used running-key ciphers extracted from books, even if he had no idea which were those books.

At the end of 1918,the ATT engineers Gilbert Sandford Vernam & Lyman F. Morehouse have invented the kind of running-key cipher which is now named binary additive synchronous stream cipher, where the enciphering & deciphering are done by a modulo-2 additive combiner (a.k.a. a XOR gate) of the plaintext symbol stream with 1 or more encryption mask symbol streams. The machine designed by Vernam and Morehouse mechanized the tedious operations of encryption and decryption, which became as easy as sending a message through any teletype.

While Vernam and Morehouse were aware in 1918 that the encryption key must be non-periodic, they were not aware of the classified work of William F. Friedman, which had been done a few months earlier, so they did not know that the key stream must be random. They have learned about this additional condition some time between 1918 and 1926. In February 1926, Vernam has published one of the most important articles in the history of cryptology, where the one-time pad has been described for the first time in the non-classified literature ("one-time pad" is a much later term, probably coined by the British; Shannon has used "Vernam cipher" for the one-time pad, but Vernam was not its inventor, but only the one who made it public).

There has been a certain Frank Miller, who has described a one-time pad already in 1882, in an obscure publication. Nevertheless, he had given no explanation for his suggestion to use a random key stream, so it is more likely that this was just a lucky guess and he had no understanding about whether the randomness is a necessary condition for the cipher to be unbreakable, besides the non-periodicity. Moreover, his publication had been completely unnoticed and forgotten, so it had no influence on the development of cryptography.

It is most likely that William F. Friedman is the one who has invented the one-time pad, because he was the one who has deciphered the running-key ciphers that were previously believed to be unbreakable and his cryptanalysis had been based precisely on exploiting the fact that the running key was not random, even if it was not periodic. So since the middle of 1918 he was perfectly aware that the only case when his method does not work is when the running key is both non-periodic and random.

There have been several books where the authors have guessed that perhaps Joseph Mauborgne, who at that time was the boss of William F. Friedman, has been the inventor of the one-time pad. I do not agree with this supposition, because there exists absolutely no evidence supporting it and because it makes no sense.

The one-time pad was a trivial consequence of the cryptanalysis work of William F. Friedman and he was a much better cryptologist than his boss. It is extremely unlikely that Friedman had not understood the consequences of his own work and that he would have needed some additional idea from his boss. Friedman has written classified reports about his work for his boss and he must also have informed Mauborgne that the traditional running-key ciphers are no longer secure and they must be replaced with ciphers that use a non-periodic and random key.

The military were interested in the Vernam-Morehouse encryption machines, so Mauborgne was in touch with the ATT engineers and he had been providing some consultancy for them. He may be the one who has informed Vernam about the one-time pad. However, there has been a published interview with Mauborgne, where he does not mention this.

Some time later, around 1924, so a couple of years before the 1926 publication of the one-time pad, Friedman has also been in contact with Vernam and other ATT engineers and he has invented a modification of the Vernam-Morehouse encryption machine that was able to generate a pseudo-random key stream with improved randomness instead of the key-stream with a very long period that was generated by the original Vernam-Morehouse machine.

I believe that most likely during this collaboration with Friedman around 1924 is when Vernam has learned about the correct requirements for a one-time pad, as Friedman must have explained to him why the modifications invented by Friedman are necessary to improve the encryption machine.