PDFtk Server on OS X 10.11

主宰稳场 提交于 2019-11-27 02:25:59

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!

Best Regards-

Sid Steward, PDF Labs

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

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

tralala

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.

John Sidles

Third Edit: The following are not fixes, but rather workarounds, (`cuz sometimes its not feasible to wait months for fixes to arrive).


Second Edit: Coherent PDF Command Line Tools (aka cpdf) is free for noncommercial use, and can be licensed for commercial use. It provides functionality comparable to pdtk and (on my MacBook Pro at least) seems to run OK under El Capitan.


Edit: This StackOverflow answer tells how to use ghostscript to concatenate files, thus providing (awkwardly) functionality similar to of "pdftk ... cat output out.pdf".


For some purposes, the package ghostscript---which ships with LaTeX distributions like texlive---offers similar (but less user-friendly) capability to pdftk.

E.g., to extract pages 6-7 from a multipage pdf document:

gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
  -dFirstPage=6 -dLastPage=7 \
  "-sOutputFile="${EXTRACTED_FILENAME_HERE}" \
  "${SOURCE_FILENAME_HERE}" ;

The above worked for me ... your mileage may vary!

Needless to say, restoring pdftk to full functionality under El Capitan would be much better ... pdftk really is a terrific utility.

Workarounds: We raised this to Sid back in August and he still has not fixed it so I think its fair to say that its a good idea to look for alternatives. Because of this, we have taken the initiative to submit a few first tools that people can enjoy for free in the following repository:

https://github.com/flexpaper/OSX-PDF-Toolkit

It contains easy to use scripts for CAT and BURST. We intend to add more tools going forward. Feel free to contribute

These new tools are using the native OSX libraries and no third party dependencies are needed whatsoever. Yay!

Edit: added info about this being a workaround

You can get to a running PDFTK Server under El Capitan if you use the manual of patching ports together with the four patches provided in Macports tickets #48528 and #49227.

The compilation of patched GCC5 took a long time on my machine. Also, it seems to be a good idea to name the local ports identically to the original ones (i.e. gcc5 and pdftk), otherwise you have to adjust the Portfiles.

It is also possible to bundle the resulting pdftk binary together with its dynamic libraries using install_name_tool on the binary and the dynamic libraries. I succeeded to run pdftk this way on two other machines.

Updated status as of 2018-05-09:

  1. It's not on brew standard sources
  2. https://github.com/spl/homebrew-pdftk is unmaintained / deprecated
  3. It is at https://www.pdflabs.com/tools/pdftk-server/
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!