I think the best way would be to get the novel as a digital text and read it in Pleco; if you tap the "+" button for every new word you tap on, you will get a personal list of flashcards--for just the words you didn't know. You could buy any Chinese book of the right level of difficulty, then search for it on the Internet by entering a long sentence from the book in Google (in quotes), then save the text to Pleco. The flashcard list will quickly get very long, so it takes some additional work to filter out the words you wish to learn.
Shun would you happen to know any good readers like Pleco, except that it does English to Chinese? Like you paste the English text, then you can click on an English word to bring up the Chinese meaning. Or maybe there is a setting in pleco that I'm missing?
there's one little trick you could use that is better than nothing. First, if you don't have it yet, you buy the 21st century English-Chinese dictionary in Pleco, which is quite a large dictionary. Then you open the English text inside Pleco's Document Reader, and instead of tapping on the English words you wish to translate, you tap-hold them until they're selected, then tap the looking glass button on iOS or the square with an arrow button on Android. This will give you a list of English-to-Chinese definitions, including the ones from the 21st century English-Chinese dictionary.
I think it would be a good thing if Pleco offered the option to define words from Western languages in Chinese through the Pop-up definition, considering that there are already quite many dictionaries available for Pleco that go from a Western language to Chinese.
I'm working on a program that takes a text file (could be a Harry Potter novel) and puts the difficult words into a flashcard list. Does anybody know if such a program already exists? (I am creating it in order to learn programming, but if it already exists I would like to know.)
That looks like a useful product; it probably contains a difficulty rating for each piece of vocabulary (like from the BCC corpus or HSK), then finds them in the text. However, if you are somewhat proficient in a programming language like Python, you could program that yourself in a very small amount of time. (Simply check for each word if the program knows its difficulty using a hash table.)