3

Similar to this question , but the solution of moving files to the home directory didn't sort it for me. So I don't think its a problem with permissions.

This is the jist of the error I got:

Error: Unable to find file.
Error: Failed to open PDF file: 
   18.png
Errors encountered.  No output created.
Done.  Input errors, so no output created.

And the command entered:

pdftk 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png 10.png 11.png 12.png 13.png 14.png 15.png 16.png 17.png 18.png cat output trippyblsmq.pdf
AdminBee
  • 21,637
  • 21
  • 47
  • 71
joeav
  • 131
  • 3

1 Answers1

5

The pdftk error, “Unable to find file” is somewhat misleading: the problem isn’t that the input files don’t exist, but that they’re not PDFs.

pdftk expects PDFs as input, it can’t import PDFs. You’ll need another tool, such as ImageMagick, to convert your PNGs to a PDF.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • sorry no... I didn't copy all the output - it gave the same error on all the files. and the command should be to convert all these .png s to a pdf file – joeav Mar 13 '20 at 16:10
  • and they exist. I can see them in the /home folder, and open them – joeav Mar 13 '20 at 16:11
  • So why does `stat 18.png` fail? That’s weird. But see my update, the problem isn’t that `pdftk` can’t find files, it’s that it can’t process them. – Stephen Kitt Mar 13 '20 at 16:13
  • I was following instructions saying pdftk can convert png to pdf without losing much resolution, like other apps might. guess that was wrong – joeav Mar 15 '20 at 13:11