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

PDF with warnings throws an exception #86

Closed
Skulli opened this issue Apr 5, 2023 · 0 comments
Closed

PDF with warnings throws an exception #86

Skulli opened this issue Apr 5, 2023 · 0 comments

Comments

@Skulli
Copy link

Skulli commented Apr 5, 2023

I have a PDF generated from Word without form fields and doing fill_form throws

SafeShell::CommandFailedException: Shell command ["/opt/homebrew/bin/pdftk", "test.pdf", "fill_form", "/var/folders/z9/9rpgvhwn7t530m5b51097mzw0000gn/T/pdf_forms-fdf20230405-31310-9dq54u", "output", "result.pdf"] failed with status pid 31387 exit 3

even though the result.pdf is successfully generated.
If i do the command by hand in the console, i get a warning

Warning: input PDF is not an acroform, so its fields were not filled.

with exit code 3

The thing is, that safe_shell checks if the exit-code is 0. Maybe #83

jkraemer added a commit that referenced this issue Sep 15, 2023
- not every non-zero exit code is an error, take that into account and
  only fail hard in case of 'real' errors
- you can still check $? to find out about the actual execution success / failure.
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