Capturing text in documents