I want to use pdftk but I always get this error zsh: bad CPU type in executable: pdftk I reinstalled pdftk and I changed the terminal from bsh to zsh as I found in my search for how to solve this error but without any success. I'm using the latest MacOS version "Catalina v10.15.4"
- 867
- 1
- 10
- 22
4 Answers
This version of pdftk works on macOS Catalina (10.15).
https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg
The link on the website is not up to date. That means by clicking the download button on the website you get an old version.
- 1,616
- 1
- 7
- 8
-
12Works on Big Sur (OSX 11) on M1 as well! – Individual11 Dec 20 '20 at 13:31
-
5This "WHY" moment brought to you by the internet – rosstex Feb 26 '21 at 09:09
-
2This works (Big Sur on Intel). Sent email to author, asking him to fix link. – Tom Hundt Apr 08 '21 at 20:42
-
5Works on Monterey on M1 too – goodniceweb Dec 24 '21 at 20:28
-
3Confirm, works on M1 without any extra effort, just run the "pdftk" command as usual. – jholster Jan 28 '22 at 08:22
-
Work Perfectly on macOs Big Sur Version 11.6 by just installing the Packeg. Thanks Men. – Hafiz Abdul Rehman May 06 '22 at 09:48
Homebrew:
brew install pdftk-java
https://formulae.brew.sh/formula/pdftk-java
Compatible with Catalina, Big Sur
- 1,054
- 4
- 15
- 39
The macos-10.11 link above worked for me on macOS 10.15 Catalina.
I emailed Sid Steward at PDF Labs about the old link. Hopefully he will update it on the PDF Labs website ;-)
- 11
- 2
As a preliminary solution, I was successful in installing the Intel version of homebrew in /usr/local (in parallel to the M1 version in /opt/homebrew) using Apple's Rosetta 2 layer. The Intel packages (homebrew formulae) seem to work without any problem on the Apple M1 architecture. Both pdftk and pandoc work even without prefixing 'arch -x86_64' (e.g., the command 'pandoc sample.md -o sample.html' as in the example linked below).
Commands:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
alias ibrew='arch -x86_64 /usr/local/bin/brew'
ibrew analytics off
ibrew install pdftk-java
ibrew install pandoc
Further information:
- 1
-
1You can just install the package mentioned in Ben's answer, no extra hacks needed on M1. – jholster Jan 28 '22 at 08:23
-
Yes, as a workaround I had also mentioned it [here](https://github.com/Homebrew/formulae.brew.sh/issues/467#issuecomment-841846989). But it seems to be an old version (2.02). Now homebrew directly supports the M1 chip ("Apple Silicon"), with pdftk-java version 3.3.2, which I consider the better solution: https://formulae.brew.sh/formula/pdftk-java#default – kkbt Jan 29 '22 at 13:17