Update pdf2text.py

Some adjusts to work in python 3