There is a bug in pdfquery ( see previous issue report). We switched to pdfminer and reduced processing time from 20 min to 2 min.