anjesh / pdf-processor

Processes the pdf and finds whether it's text based or not and extracts data from the pdf in either case
MIT License
5 stars 7 forks source link

Python subprocess issue #3

Open gmagnai opened 8 years ago

gmagnai commented 8 years ago

Hello.

Im using this project in my web site. But i had a problem about python sub process.

Here is a my process log.

_Traceback (most recent call last): File "tests/PdfProcessorTest.py", line 35, in testScannedPdf pdfProcessor = PDFProcessor('tests/sample-scanned.pdf', self.outdir) File "PdfProcessor.py", line 20, in init self.process() File "PdfProcessor.py", line 37, in process self.separatePdfPages() File "PdfProcessor.py", line 71, in separatePdfPages pdfTkProcessStatus = pdfTkSeparate.extractPages() File "pdftools/PdfTkSeparate.py", line 18, in extractPages cmdOutput = subprocess.call([self.cmd, self.infilepath, 'burst', 'output', os.path.join(self.outdir, "%d.pdf")]) File "/usr/lib/python2.7/subprocess.py", line 522, in call return Popen(_popenargs, _kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 710, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child raise childexception OSError: [Errno 2] No such file or directory *

I guess problem might be here at: cmdOutput = subprocess.call([self.cmd, self.infilepath, 'burst', 'output', os.path.join(self.outdir, "%d.pdf")])

in PdfSeperate.py

Please help me asap..

anjesh commented 8 years ago

Are you sure you have all the prerequisites https://github.com/anjesh/pdf-processor#prerequisites? Also check if those input files are there while calling the subprocess.