Skip to content

Instantly share code, notes, and snippets.

@seignovert
Last active January 14, 2019 17:09
Show Gist options
  • Save seignovert/45b5dbcb14335f1b94d221aa9b98cbab to your computer and use it in GitHub Desktop.
Save seignovert/45b5dbcb14335f1b94d221aa9b98cbab to your computer and use it in GitHub Desktop.
PDFtk install on macOS > 10.11

PDFtk install on macOS > 10.11

Fix: Download pdftk_server-2.02-mac_osx-10.11-setup.pkg, not listed on the official website yet!

[DEPRECIATED] Manual install

#!/bin/bash

VERSION='2.02'
PDFLABS='https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit'
PKG="pdftk_server-${VERSION}-mac_osx-10.06-setup"

CELLAR='/usr/local/Cellar/'
PDFTK=${CELLAR}/pdftk/${VERISON}

PWD=$(pwd)

cd /tmp
wget -o ${PKG}.pkg ${PDFLABS}/${PKG}.pkg
pkgutil --expand ${PKG}.pkg pdftk_package

cd pdftk_package
mv pdftk.pkg/Payload pdftk.pkg/payload.gz
gunzip pdftk.pkg/payload.gz
cpio -iv < pdftk.pkg/payload

mkdir -p ${PDFTK}/bin ${PDFTK}/lib ${PDFTK}/share/man/man1
mv bin/pdftk ${PDFTK}/bin/.
mv lib/* ${PDFTK}/lib/.
mv man/pdftk.1 ${PDFTK}/share/man/man1/.

cd $PWD
rm -rf /tmp/${PKG}.pkg /tmp/pdftk_package

brew doctor
brew link pdftk

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment