python has plenty of packages that allow to convert pdf to text (extract text from pdf) in a native way, not by sending keys to external application.
Just to name a few (in no particular order, i.e. not as recommendation):
textract
PDFminer - python2 and its pdf2txt tool. also pdfminer.six - a fork with python2/3 support
slate - wrapper around PDFminer
Just to name a few (in no particular order, i.e. not as recommendation):
textract
PDFminer - python2 and its pdf2txt tool. also pdfminer.six - a fork with python2/3 support
slate - wrapper around PDFminer