refactor pdftext2.py