I’m on debian 10. I was trying to use pdftk in order to use the generated_fdf command.
When I just
apt-get install pdftk
then
pdftk a.pdf generated_fdf output a.fdf
It output
Error: Unable to find file.
Error: Failed to open input PDF file:
generated_fdf
Errors encountered. No output created.
I figured maybe the debian repo is not up to date so I decided to build it from the git repo
then I used :
java -jar /lib/pdftk/build/jar/pdftk.jar a.pdf generate_fdf output a.fdf
it worked !!!
So in order to have the same code in dev (debian), testing (ubuntu) , prod (Windows) I decided to create a file here usr/bin/pdftk
#!/usr/bin/env sh
echo "pdftk_perso"
ls -l "$1"
whoami
java -jar /lib/pdftk/build/jar/pdftk.jar "$@"
the output is now
pdftk_perso
-rw-r--r-- 1 user user 208557 Sep 22 16:06 a.pdf
user
Error: Unable to find file.
Error: Failed to open input PDF file:
generated_fdf
Errors encountered. No output created.
Done. Input errors, so no output created.
So again it’s not working as if it was trying to find the file named "generated_fdf"
FYI it works fine with windows and ubuntu
2
Answers
You have mistyped
pdftk a.pdf generated_fdf output a.fdf
asgenerated_fdf
is not a command. The command isgenerate_fdf
to create an fdf file. You have corrected the command by yourself on windows. See the difference in your both commands. Also PDFTK is not giving an error, it is saying that the file was not found, so the command is not right by itself. Run the same command via your debian terminal, it will workpdftk "Business model.pdf" generate_fdf output k.fdf
let me know if you face an issue.
Also i am facing same issue, But from following steps resolved my issue –
Note: You may need to logout and log back in to reset your session.
pdftk input.pdf cat output new.pdf