extract text from a pdf as an array of text blocks