virantha / pypdfocr

Python script to do PDF OCR conversion using Tesseract
Apache License 2.0
372 stars 114 forks source link

Ghostscript execution fails on Windows 10 #68

Open r4ph43l-GitHub opened 6 years ago

r4ph43l-GitHub commented 6 years ago

Just encountered an issue running pypdfocr on Windows 10.

Ghostscript, being installed on Windows 10 by default into "C:\Program Files\gs\gs9.21\bin\gswin64c.exe" fails execution using subprocess.check_output command in pypdfocr_gs.PyGs._run_gs.

The execution on a cmd line of the complete same command works.

r4ph43l-GitHub commented 6 years ago

Seems not to be the first appearance of this issue: https://stackoverflow.com/questions/30014607/command-program-not-executing-from-python-subprocess

unfortunately neither putting ghostscript binary directory inside path environment nor using string escaping works. After putting gs-bin directory into the path environment, the error I get is "The syntax for the filename, directoryname or drive description is wrong" "The filename, directory name, or volume label syntax is incorrect" resulting in an "ERROR: Ghostscript execution failed"