Search code examples
linuxruby-on-rails-5apple-m1pdftk

SafeShell::CommandFailedException: in pdftk


I am getting SafeShell::CommandFailedException: Shell command ["/opt/homebrew/bin/pdftk" error while executing pdftk.fill_form 'public/data.pdf', pdf_name_with_path, data, :flatten => true

Earlier it was working when i was using pdftk, now i just installed java-pdftk using arch -arm64 brew install pdftk-java and it stopped working.

I already updated the pdftk path after installing it.

I am using above in RubyonRails5 and gem pdf-forms

I am using Mac M1(12.3.1)


Solution

  • The Problem which I was making here is that I accidently deleted the folder(tmp/pdf) where I was generating the pdf. So, as per this question, the path at pdf_name_with_path was not a valid path. I updated the path and it works.

    But yes, the pdftk error was misleading us.