"Bad CPU type in executable" when running pdftk

Solution 1:

As it says on https://www.pdflabs.com/tools/pdftk-server/, PDFtk Server is for "Mac OS X 10.6 (Snow Leopard), 10.7 (Lion) and 10.8 (Mountain Lion)". The package only contains a 32bit binary which won't run on Catalina or Big Sur.

You may be able to install directly from source (see further down on the same page), or you reach out to the developers and ask for an update.

Solution 2:

The version of pdftk provided here works on macOS Big Sur (= macOS 11) with the Apple M1 chip:

https://stackoverflow.com/questions/60859527/how-to-solve-pdftk-bad-cpu-type-in-executable-on-mac/60889993#60889993

The direct link is:

https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg

See also this preliminary solution using homebrew with Rosetta: https://stackoverflow.com/a/67561373/15944671

See also: https://gist.github.com/jvenator/9672772a631c117da151