In previous centuries, when few people could read and write, to have your portrait painted with a book showed you to be well educated. It might also refer specifically to your job or profession as a writer or scholar: sometimes the title of the book provides a clearer clue. But in the seventeenth century early science and medicine were not far from magic, and an excessive interest in book-learning was often mocked.
From the late eighteenth century, as writers and poets of the Romantic movement appealed to the inner imagination, artists too became increasingly interested in private domestic life. The solitary reader, lost in her book, became a common subject. Doubtless it also helped keep the sitter still enough to paint.