Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subprocess.Popen call can't find pdftk on Windows #11

Open
dgwaldo opened this issue Feb 23, 2018 · 0 comments
Open

subprocess.Popen call can't find pdftk on Windows #11

dgwaldo opened this issue Feb 23, 2018 · 0 comments

Comments

@dgwaldo
Copy link

dgwaldo commented Feb 23, 2018

We have been running pdfjinja and have ran into an interesting issue. When calling our python code directly from the command line everything works. However when our code is started by another calling process, in this case ArcGIS Server, it fails on the call to Popen.

If we hard code our path to pdftk into pdfjinja like so, it works.

args = [
r"C:\Windows\SysWOW64\PDFtk Server\bin\pdftk.exe",
self.filename,
"fill_form", "-",
"output", "-",
"dont_ask",
"flatten"
]

I believe it has something to do with the following Python bug, and isn't directly an issue with pdfjinja.
https://bugs.python.org/issue8557

Root cause seems to be that Popen isn't respecting anything on the System PATH variable in Windows.

However, perhaps there is a way around it in pdfjinja? Like perhaps passing down the current env into the process being opened. The issue is a bit of a maintainability nightmare for us.

Additionally, I've found a very similar issue that may be helpful.
https://gis.stackexchange.com/questions/234664/how-to-set-up-geoprocessing-service-to-fill-out-pdf-form-from-within-web-appbuil

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

No branches or pull requests

1 participant