This Exel spreadsheet works pretty well. Input the level of the Wizard (1 through 20), his INT (10 through 45), and how developed the book is. The last is binary in nature. Either he only the spells that he got from going up each level (which is very few), or he has purchased other spells over time (normal). The sheet isn’t perfect; it still generates some duplicate spells, so you’ll need to swap those out. It also doesn’t generate lists for specific schools. It also doesn’t prioritize spells, so you’ll get lots of random spellbooks rather than ones filled with Magic Missile, Fireball, Web, Enlarge person, and the other standard spells. Again, if that doesn’t fit your needs, just swap them out. When you have a list that looks good (hit f9 to generate another one), just cut and paste it.
The sheet does use recursive iteration, so if it isn’t working on your system, click on the Window Button (top left), select Excel Options/Formulas, and turn on recursive iteration. Using 100 iterations should do the trick.
And if you’re interested in Pathfinder Wizards, you might also want to look at my older post on Selling Wizard Spells in Pathfinder.