I have installed pdftk from https://www.pdflabs.com/tools/pdftk-server/ on my mac and when I try to run it it fails.
$ pdftk -version
-bash: /usr/local/bin/pdftk: Bad CPU type in executable
How can I fix this?
I have installed pdftk from https://www.pdflabs.com/tools/pdftk-server/ on my mac and when I try to run it it fails.
$ pdftk -version
-bash: /usr/local/bin/pdftk: Bad CPU type in executable
How can I fix this?
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.
The version of pdftk provided here works on macOS Big Sur (= macOS 11) with the Apple M1 chip:
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
file /usr/local/bin/pdftk
show?