added ability to extract text from pdfs to pdf function