Hi everyone, I am a novice in Python programming (and programming in general) and am trying to deploy a Flask project to pythonanywhere. My current issue is trying to use pypdftk to combine and fill some stored pdf form files. My approach worked great when I deployed it locally but has run into some issues. Here is my original error:
subprocess.CalledProcessError: Command '/usr/bin/pdftk /home/lewisjluck/CPApp/static/./pdf_templates/form.pdf fill_form /tmp/tmp5v62wd_f output /tmp/tmps3c5uf2t flatten' returned non-zero exit status 134.
After some digging I found this link: "https://stackoverflow.com/questions/65646864/non-zero-exit-status-1-due-to-pdf-file-not-found-when-using-pypdftk-to-fill-pd" of someone who has experienced similar issues in Django. They suggested putting the form templates in the same file as wsgi.py. I tried that as below but still the same error:
subprocess.CalledProcessError: Command '/usr/bin/pdftk /var/www/form.pdf fill_form /tmp/tmp4efb8uye output /tmp/tmppef8_4xl flatten' returned non-zero exit status 134.
I'm guessing the issue is to do with pypdftk not being able to handle the paths online? I have already made all the forms relative etc. using os.path, so am unsure how else to fix this.
Any help given would be greatly appreciated. Thanks so much! Lewis