Extracts text from pdf or docx