PDFtk Server on OS X 10.11

39,410

Solution 1

Thank you for your patience. I have successfully tested this pdftk installer and binary on OS X 10.11, El Capitan:

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

I will update our PDF Labs site soon to reflect this update.

If you already have pdftk installed from the old installer, this should install right on top of it without a problem -- it shouldn't be necessary to remove the old pdftk before installing this one.

Note that this installer/binary has not yet been tested on older versions of OS X.

Please let me know how this works for you.

I want to thank Aaron for opening this thread and for bringing helpful attention to the problem we were having with the build tools. I also want to thank the MacPorts team for their professional and timely work!

Solution 2

Thanks to github.com/quantiverge, pdftk should be installable under brew. This one is tested in OSX Sierra.

Run the following in the terminal.

brew install https://raw.githubusercontent.com/turforlag/homebrew-cervezas/master/pdftk.rb

Updated with fixes from github.com/zph - thanks!

Solution 3

2020 Update

WORKED:

Please note that in order to install it on macOS High Sierra (10.13.5) or on Mac OS Catalina (10.15) (as mentioned by Ivan Kurmanov in the comments), I had to download the package from:

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

Of course, it won't let you install normally as it's not downloaded from "App Store" so use following instructions:

  1. In the Finder, locate the app you want to open.

  2. Don’t use Launchpad to do this. Launchpad doesn’t allow you to access the shortcut menu.

  3. Control-click the app icon, then choose Open from the shortcut menu.

  4. Click Open.

  5. The app is saved as an exception to your security settings, and you can open it in the future by double-clicking it just as you can any registered app.

After that just go through the installation process, which is pretty much NEXT - NEXT and enjoy :)

DID NOT WORK:

The following brew command DID NOT work for me:

brew install https://raw.githubusercontent.com/turforlag/homebrew-cervezas/master/pdftk.rb

It gave following error:

Failure while executing; /usr/bin/xar -xf /xxxx/Library/Caches/Homebrew/downloads/\#\{url_sha256\}--\* exited with 1.

Good luck!

Solution 4

Pdftk is currently not working for me on OSX Sierra.

If you have docker installed on your system, you can use my lightweight docker image instead:

$ docker run -v $(pwd):/files alpine-pdftk --help

Even better, simply use the following script as a drop in replacement:

#!/usr/bin/env bash
docker run --rm -v $(pwd):/files jottr/alpine-pdftk "$@"

Now you can use pdftk as expected: ./pdftk --help

Solution 5

work for me install the new one, https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg

remove the old pdftk version; search the pdftk from the finder, move to trash and also have pdftk_uninstall.sh done.

$ pdftk -version

pdftk 2.02 a Handy Tool for Manipulating PDF Documents Copyright (c) 2003-13 Steward and Lee, LLC - Please Visit: www.pdftk.com This is free software; see the source code for copying conditions. There is NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Share:
39,410

Related videos on Youtube

Aaron
Author by

Aaron

Updated on March 24, 2022

Comments

  • Aaron
    Aaron over 2 years

    I've been using PDFTK Server on OSX pre 10.11 for over a year without any issues running commands on the command line.

    After installing OSX 10.11 beta, I can no longer run any PDFTK Server commands on the command line. It does not throw any error, all the commands I try to execute just hang indefinitely.

    I installed from a pkg I downloaded from the PDFTK Server website as always:

    https://www.pdflabs.com/tools/pdftk-server/

    I've also tried installing from source with Homebrew. The installation works, but I get the same results, the commands just hang in the terminal:

    Homebrew tap

    I've sent in the complaint to Apple via their Feedback Assistant application that gets installed when installing the beta two months ago without a response.

    I've been told regarding the Apple Feedback Assistant:

    You likely won't ever receive a response. Apple only replies through Feedback Assistant for major bugs of the operating system where they need additional information. It is not a way to obtain support, even less so for a third-party application.

    I've also reached out to PDF Labs, the makers of the package, without response.

    On MacPorts they're having an issue with the build on OS X 10.11, does this mean that there is a compatibility issue with PDFtk and 10.11 at the software level?

    I've searched the web for a clue as to what might be causing the issue and how to fix it, but have found nothing tangible.

    On OS X, I don't know how to go about figuring out if there is now a permission or path or even a Java issue after the upgrade.

    Any help either trouble shooting the root cause or offering a fix is appreciated.


    UPDATE 1:

    I heard back from Sid Steward at PDF Labs:

    We have been wrestling with this almost as long as the beta has been out. We are still working on it. There appears to be an incompatibility with one of the (non-Apple) libraries that pdftk uses and OS X 10.11. Presently I am installing yet another update to Apple's developer tools with the hope that it will solve the problem. I will update you with our progress.


    UPDATE 2:

    Sid Steward at PDF Labs again:

    It looks like there are two threads running under pdftk, and that they are deadlocked. That means that each thread is waiting for the other to finish. I'm not an expert here, but that's my impression. Here is a screenshot from Mac's Activity Monitor to illustrate:

    enter image description here

    The above snapshot is from trying to run the pdftk binary currently on our site on OS X 10.11. The libgcj library noted above comes with pdftk, where the others are OS X libraries.

    As I say, I just installed Xcode 7.0.1, which was released yesterday on the App store. I will now attempt to use these tools to build pdftk.


    UPDATE 3:

    MacPorts is working the build issue with PDFtk, this is an update on that thread (Note: this is unrelated to PDFtk Labs):

    This is due to the recompilation of libunwind in 10.11 using Apple Clang 7 producing new valid optimizations (according to Apple) that tickle an unknown bug in FSF boehm-gc.

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66848

    Don't expect any fixes from Apple as they can't touch the GPLv3 code to look at the FSF boehm-gc problem (unless they used the gcc43 package which should still be GPLv2). That this issue is triggered by the recompilation of libunwind is demonstrated by that fact that substituting the libunwind.dylib from 10.10 eliminates both the boehm-gc and gcj failures.

    Note that is was filed as radr://21372179, "the FSF boehm-gc library built on 10.10 fails to pass its tests on 10.11" but closed as being an FSF boehm-gc bug.


    UPDATE 4:

    MacPorts found a way to solve the build issue, this is an update on that thread

    The attached Portfile.diff (when used with the proposed gcc5 update on #49227 which fixes gcj) solves the build issue with pdftk.


    UPDATE 5:

    Sid Steward at PDF Labs has a successful build, his feedback:

    A fix for MacPorts gcc5 allowed me to build a working pdftk that merges PDFs on El Capitan. The fix was added to the ticket you had posted to:

    MacPorts

    I will proceed to fully test this pdftk before packing it up into an installer. This process could take a couple days.


    • hrbrmstr
      hrbrmstr almost 9 years
      Paid support might get you faster response from PDF Labs.
    • hrbrmstr
      hrbrmstr almost 9 years
      homebrew is 25% of the way through a build. I'll let you know how it goes.
    • Aaron
      Aaron almost 9 years
      Make any headway on the build @hrbrmstr ?
    • Aaron
      Aaron over 8 years
      I thought about PDF Labs paid support. If I get a response email, I'll try asking about it.
    • hrbrmstr
      hrbrmstr over 8 years
      apologies for the delay. Two separate attempts to build on OS X El Capitan (GM and 10.11.1 beta) failed miserably (hung at one step in the compilation)
    • John Sidles
      John Sidles over 8 years
      Thank you for pursuing this issue ... hope it gets fixed soon ... my appreciation and thanks are extended to all who are working on it.
    • sethetter
      sethetter over 8 years
      Also having this issue. Tried disabling the new SIP to see if it helped, no such luck.
    • Brian
      Brian over 8 years
      Same issue here as well. Unfortunately I don't really have the skill set to troubleshoot this one. Fingers crossed that the PDF Labs folks make some headway
    • ruby_object
      ruby_object over 8 years
      about update3: you can't easily substitute the files apple.stackexchange.com/questions/101328/…
    • ruby_object
      ruby_object over 8 years
      I managed to reboot in recovery mode, supressed system integrity by running csrutil disable in the terminal and replaced libunwind with yosemite version.
    • Alex Wood
      Alex Wood over 8 years
      Thanks for looking into this @Aaron. As far as tracking the pdftk deadlock issue, is the MacPorts ticket you've linked to the best place to check? Or does PDF labs have a bug tracker or forum of some sort discussing the progress on this issue?
    • Aaron
      Aaron over 8 years
      Great question @AlexWood. As far as I know, PDF labs is working the issue, but doesn't have a public bug tracker. If you find out otherwise, I'll update the main text accordingly.
    • Alex Wood
      Alex Wood over 8 years
      Sid from PDF Labs just sent me this updated installer: pdflabs.com/tools/pdftk-the-pdf-toolkit/…. He said it should work on El Capitan - I'm testing it out right now.
    • alle
      alle over 8 years
      Sublime! This IS the solution, it works! @AlexWood, thank you very much for having followed the whole issue. Thanks Sid from PDF Labs. I was struggling around on applying the diff patch, but it didn't build correctly. Thanks again!
    • Siva
      Siva over 8 years
      I have tried that update but it failed with the following info. I try to do pdftk --version and i get the following: dyld: Symbol not found: __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev Referenced from: /usr/local/bin/pdftk Expected in: /usr/local/bin/../lib/libstdc++.6.dylib in /usr/local/bin/pdftk Trace/BPT trap: 5
    • TSGM
      TSGM over 8 years
      @Siva: there is a non-too good fix here: stackoverflow.com/questions/34289231/… ... basically add an extra export path command
    • ierdna
      ierdna almost 7 years
      pdftk runs fine on my osx 10.11 but when i run any pdftk command e.g. pdftk test.pdf dump_data_fields it just sits there doing nothing. has anyone ran into this?
  • FlowPaper Team
    FlowPaper Team over 8 years
    You're more than welcome to submit those tools to the repository. It shouldn't be hard to add watermarking and concatenation with adding and removing at the same time.
  • Dan2552
    Dan2552 over 8 years
    is there a homebrew tap we can use to get this?
  • Charphacy
    Charphacy over 8 years
    Thanks for making this available. It solved the issue I was having with pdftk. FWIW, two issues with your installer, first (minor) is that it isn't signed. The second is that it installs a link into /usr/share/man/man1. I'm actually slightly amazed that El Capitan's System Integrity Protection allows this, since I'd consider it a system directory. The right place to put the manual page link (to mirror the /usr/local/bin link for the executable) is /usr/local/share/man/man1.
  • Siva
    Siva over 8 years
    I am not sure why, but i try to install this update and i get the following issue :dyld: Symbol not found: __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev Referenced from: /usr/local/bin/pdftk Expected in: /usr/local/bin/../lib/libstdc++.6.dylib in /usr/local/bin/pdftk Trace/BPT trap: 5
  • nip3o
    nip3o over 8 years
    It should be noted that the pdftk homepage is not yet updated, so even if you have installed version 2.02 from the webpage, you will need to re-install it using the file in this answer.
  • n370
    n370 over 8 years
    The burst operation wasn't behaving as expected on my machine. It's OSX 10.11.1 running the pdftk installed from the .pkg I just downloaded from the official website pdflabs.com/tools/pdftk-the-pdf-toolkit/…. The website has't been updated yet. Overwriting the previous installation with the installer provided by Sid here solved my issue.
  • Blairg23
    Blairg23 over 8 years
    This is a great update! Can you update your website to include it?
  • Markus
    Markus over 8 years
    This version worked fine for me on El Capitan. Thanks Sid for keeping this great tool up-to-date!
  • George Vinogradov
    George Vinogradov over 8 years
    Doesn't work for me on OS X 10.11.2. Could you provide instructions for clean reinstall of pdftk?
  • Gisonrg
    Gisonrg over 8 years
    Worked well for me on 10.11.2. Thanks!
  • Ben
    Ben over 8 years
    on my El Capitan version (10.11.2) It installs, but complains "dyld: Library not loaded: @executable_path/../lib/libiconv.2.dylib\n", " Referenced from: /opt/pdflabs/pdftk/lib/libgcj.16.dylib\n Reason: Incompatible library version: libgcj.16.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0. i'm nervous to upgrade this library as i know iconv is used by other stuff...
  • TSGM
    TSGM over 8 years
    @Ben I'm having the same issue of missing libraries. Anybody have a fix, perhaps in the form of a necessary MacPort package?
  • Ben
    Ben over 8 years
    I actually ended up using Ghostscript to do my pdf to text conversion. Don't have cmd to hand will update next week
  • Alexander Rolek
    Alexander Rolek over 8 years
    Thanks for the fix and responding to this thread. I downloaded PDFtk from your website today for OSX El Capitan and it hung just as described in this thread. The version reported by pdftk --version from the download was 2.02. I just downloaded the linked reference in this response also reporting version 2.02 and it did not hang. You might want to check the OSX version you're providing at pdflabs.com/tools/pdftk-server
  • Matt
    Matt about 8 years
    As of right now it will not run with default security settings(to be expected). Source download and install instructions for OS X would be useful, something beyond a homebrew: the crutch of those too lazy to use sudo easy_install pip to install python packages the proper way; there is not a good excuse for having two versions of Python 2.7 for x86_64, but that is a story for a different day.
  • Aaron
    Aaron almost 8 years
    @sidsteward have you tested on macOS Sierra?
  • David Barrows
    David Barrows over 7 years
    Hi, just wanted to add my voice to this chorus; I had the same problem with it hanging on El Capitan 10.11.6, and the new version from the link above did fix the problem. @sidsteward I'm very grateful as PDFtk is an incredibly useful tool. Thanks.
  • Rho Phi
    Rho Phi over 7 years
    in OS X Sierra pdftk gives dyld: Symbol not found: __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev Referenced from: /usr/local/bin/pdftk Expected in: /usr/local/bin/../lib/libstdc++.6.dylib in /usr/local/bin/pdftk
  • Henry Schreiner
    Henry Schreiner over 7 years
    @obh's answer worked for me in Sierra, but I appreciate having a docker solution too. Especially like the fact you used alpine :)
  • StvnW
    StvnW about 7 years
    This package resolved the problem for me on Sierra as well (10.12.4). Thank you.
  • ierdna
    ierdna almost 7 years
    it works on some files, but fails on files that have an owner password (but no user password). the same version on linux doesn't have this bug
  • Albert-Jan Verhees
    Albert-Jan Verhees almost 7 years
    I faced the problem on 10.12.5 and this package resolved it.
  • Markus
    Markus almost 7 years
    Just ran into the same problem - first downloaded the non-working verison from the homepage and then found the working one here. Please update the homepage :)
  • Steven Aguilar
    Steven Aguilar almost 6 years
    What if I want to run that image within a container, would I have to update the Dockerfile?
  • Grocery
    Grocery almost 6 years
    Good news! Website still lists outdated one for 10.6.
  • BT643
    BT643 almost 6 years
    The website is still outdated 3 years on but this link just worked for me :)
  • Jason S
    Jason S over 5 years
    Works great for El Capitan! Could you update the website?
  • Robert Brisita
    Robert Brisita about 5 years
    If going the Homebrew route, the above didn't fully work. Delete depends_on :macos => :lion and replace @tarball_path with the downloaded path. After the script crashed, the download should be in: $HOME/Library/Caches/Homebrew/downloads/. After the adjustments it should work fine on High Sierra 10.13.6.
  • Ivan Kurmanov
    Ivan Kurmanov over 4 years
    The above link, pdflabs.com/tools/pdftk-the-pdf-toolkit/… seems to produce a working pdftk on Mac OS Catalina (10.15).
  • Ivan Kurmanov
    Ivan Kurmanov over 4 years
    This also seems to work on Mac OS 10.15 (Catalina). Thank you!
  • Abhay Maurya
    Abhay Maurya over 4 years
    @IvanKurmanov thank you for the input, i will add it to the answer
  • killerkiara
    killerkiara over 4 years
    Great!! This really saved me. i was close on giving up with the pdf_forms gem and look for another solution.
  • Stephenmjm
    Stephenmjm over 4 years
    This update works on my OSX 10.13.6 ! Thank you! And that would be really good if the website get updated
  • cweekly
    cweekly over 3 years
    2020-Dec-21 - confirmed this works, on macOS 10.15.7 (Catalina) 1. DL pdflabs.com/tools/pdftk-the-pdf-toolkit/… 2. Open Finder, use Ctl+click to open from shortcut menu (to bypass SIP) 3. Launch and follow a couple defaults when prompted ... Result: which pdftk -> /usr/local/bin/pdftk pdftk --version -> (2.0.2) FTW!
  • ecjb
    ecjb over 3 years
    Didn't work in catalina 10.15.7: 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of pdftk formula file from an arbitrary URL is unsupported!