ghostscript gets stuck on error with some pdfs on Ubuntu 13.10 and resul...

...ts are bad.

implemented check for pdftotext from poppler-utils package for better results and no getting stuck on error.