I'm trying to use pdftk (v 1.40) to combine some pdfs (using it's cat command). As a simple test, I can do

pdftk "/home/deploy/Foo - Bar.pdf" cat output results.pdf

and that works fine (I'm only combining one file here, but it's still a valid test). But, if the filename has an emdash it balks:

$ pdftk "/home/deploy/Foo — Bar.pdf" cat output results.pdf
Error: Failed to open PDF file: 
   /home/deploy/Foo — Bar.pdf
Errors encountered.  No output created.
Done.  Input errors, so no output created.

The file exists:

$ ls -l ~/Foo*
-rwxr-xr-x 1 deploy deploy 15180 2017-11-01 11:15 /home/deploy/Foo - Bar.pdf
-rwxr-xr-x 1 deploy deploy 15180 2017-11-01 11:14 /home/deploy/Foo — Bar.pdf

I googled this a bit and saw someone complaining that it can't handle umlauted characters, so I thought it might be something to do with extended character sets, or character encoding generally.

  • The solution was just to upgrade pdftk, doh. I don't know whether to delete this question or put an answer in for it.... – Max Williams Nov 1 '17 at 12:09
  • 1
    Posting an answer would be great! – terdon Nov 1 '17 at 12:29

In case anyone else encounters this, the solution was simply to upgrade pdftk. I had version 1.40, the fix was in v1.41!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.