I see it does not like spaces in the file name -----Original Message----- From: legau...@gmail.com <legau...@gmail.com> Sent: Friday, February 14, 2020 7:55 AM To: 'Bheesham Persaud' <m...@bheesham.com>; python-list@python.org Subject: RE: ghostscripts in python with watchdog
I'm not sure what happens, when I'm testing and suddenly I will start getting this error. Error: /undefinedfilename in (1) Operand stack: Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push Dictionary stack: --dict:732/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- Current allocation mode is local Last OS error: No such file or directory GPL Ghostscript 9.50: Unrecoverable error, exit code 1 -----Original Message----- From: Python-list <python-list-bounces+legaulph=gmail....@python.org> On Behalf Of Bheesham Persaud Sent: Friday, February 14, 2020 1:26 AM To: python-list@python.org Subject: Re: ghostscripts in python with watchdog Hey! If you change the "-sOutputFile` parameter you pass into gswin64c. For example, something like: output_directory = os.path.join(os.path.dirname(input_src), "out") And then you should be able to modify the call to `os.system` to something like: os.system( "gswin64c -q -dBATCH -dNOPAUSE" "-sOutputFile={output_directory}/page{page:04d}.pdf" " -dFirstPage={page} -dLastPage={page}" " -sDEVICE=pdfwrite {input_pdf}" .format( page=i, input_pdf=input_pdf, output_directory=output_directory ) ) -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list