Skip to content

Conversation

@corsair20141
Copy link

When I try to use the compress=True, power=0 or any other power, I get a 'can't find the file specified' error.

converter.convert(source, target, timeout=2, print_options=print_options, compress=True, power=3)

File ~\mambaforge\envs\rss\Lib\site-packages\pyhtml2pdf\converter.py:40 in convert
__compress(result, target, power)

File ~\mambaforge\envs\rss\Lib\site-packages\pyhtml2pdf\compressor.py:50 in __compress
compress(tmp_file, target, power)

File ~\mambaforge\envs\rss\Lib\site-packages\pyhtml2pdf\compressor.py:33 in compress
subprocess.call(['gs', '-sDEVICE=pdfwrite', '-dCompatibilityLevel=1.4',

File ~\mambaforge\envs\rss\Lib\subprocess.py:389 in call
with Popen(*popenargs, **kwargs) as p:

File ~\mambaforge\envs\rss\Lib\site-packages\spyder_kernels\customize\spydercustomize.py:109 in init
super(SubprocessPopen, self).init(*args, **kwargs)

File ~\mambaforge\envs\rss\Lib\subprocess.py:1022 in init
self._execute_child(args, executable, preexec_fn, close_fds,

File ~\mambaforge\envs\rss\Lib\subprocess.py:1491 in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] The system cannot find the file specified

@corsair20141
Copy link
Author

When I try to use the compress=True, power=0 or any other power, I get a 'can't find the file specified' error.

converter.convert(source, target, timeout=2, print_options=print_options, compress=True, power=3)

File ~\mambaforge\envs\rss\Lib\site-packages\pyhtml2pdf\converter.py:40 in convert __compress(result, target, power)

File ~\mambaforge\envs\rss\Lib\site-packages\pyhtml2pdf\compressor.py:50 in __compress compress(tmp_file, target, power)

File ~\mambaforge\envs\rss\Lib\site-packages\pyhtml2pdf\compressor.py:33 in compress subprocess.call(['gs', '-sDEVICE=pdfwrite', '-dCompatibilityLevel=1.4',

File ~\mambaforge\envs\rss\Lib\subprocess.py:389 in call with Popen(*popenargs, **kwargs) as p:

File ~\mambaforge\envs\rss\Lib\site-packages\spyder_kernels\customize\spydercustomize.py:109 in init super(SubprocessPopen, self).init(*args, **kwargs)

File ~\mambaforge\envs\rss\Lib\subprocess.py:1022 in init self._execute_child(args, executable, preexec_fn, close_fds,

File ~\mambaforge\envs\rss\Lib\subprocess.py:1491 in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] The system cannot find the file specified

I figured it out; I had to swap "gs" to "gswin64c" to specify my executable install, and the 'c' specified headless mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants