5

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?

5
  • 1
    What kind of Mac do you have, where did you install pdftk from and what does file /usr/local/bin/pdftk show?
    – nohillside
    Commented Feb 23, 2021 at 6:32
  • 1
    Does this answer your question? Commented Feb 23, 2021 at 6:50
  • @nohillside I have macOs catalina and i installed it from official website link
    – Madhan
    Commented Feb 23, 2021 at 7:32
  • So what does the file command show?
    – nohillside
    Commented Feb 23, 2021 at 7:35
  • @nohillside file command showing as /usr/local/bin/pdftk: Mach-O executable i386
    – Madhan
    Commented Feb 23, 2021 at 7:38

2 Answers 2

4

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.

1
  • Very good nohillside
    – BabyBoy
    Commented Feb 23, 2021 at 8:10
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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .