Optimize Functions In Python Pdf To Text