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

Non-Zero exit status of pdftk is ignored #80

Closed
sriedel opened this issue Dec 11, 2020 · 2 comments
Closed

Non-Zero exit status of pdftk is ignored #80

sriedel opened this issue Dec 11, 2020 · 2 comments

Comments

@sriedel
Copy link

sriedel commented Dec 11, 2020

Archlinux supplies the java port of pdftk as the 'pdftk' package, but apparently has not all required depencies declared.
Calling PdfForms#get_fields returns an empty hash in this case.

The cause is that #pdftk.call_pdftk path, dump_method in lib/pdf_forms/pdf.rb:35 returns the following string:

"Error: could not load a required library for this operation.\njava.lang.NoClassDefFoundError: org/apache/commons/lang3/StringEscapeUtils\nMake sure that bcprov and commons-lang3 are installed and included in the\nclasspath. See also https://gitlab.com/pdftk-java/pdftk/issues/2.\n No output created.\n"

and the underlying process terminates with exit status 1.

Maybe a solution would be to use SafeShell.execute! instead of SafeShell.execute in PdftkWrapper#call_pdftk

@rafalpetryka
Copy link

Based on history of 1.4.0
https://github.com/jkraemer/pdf-forms/blob/master/History.txt
i think that issue could be closed

@jkraemer
Copy link
Owner

true :)

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

3 participants