Help us understand the problem. What is going on with this article?

pdftk on Mac OSX10.11 and later

pdfをterminalで利用したいと思い調べていたら, pdftkを知った.
OSX10.11からは新しいverのを利用しないと動かない等, いくつか注意が必要だったのでメモ.

install

apt-get, brew等なら下記

ubuntu.
$ sudo apt-get install pdftk
mac.
$ brew install pdftk

でinstallできるらしい(私はできなかった)が, 古いらしいのでダメだそうです.

なので, 本家
https://www.pdflabs.com/tools/pdftk-server/
に行ってダウンロードしてインストールしたほうが良いらしい.

ただし, macのOSX10.11(El capitan)だとこれではダメだった.
こちら
http://stackoverflow.com/questions/32505951/pdftk-server-on-os-x-10-11

https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg
が10.11版なので, コレをダウンロードしてinstallしたら上手く行った.
(URL的に本家っぽいけど, どうしてコレをトップに置いてないんだろう...?)

commands

merge
$ pdftk input1.pdf input2.pdf output output.pdf

merge all
$ pdftk *.pdf output output.pdf

stamp
$ pdftk input.pdf stamp header.pdf output output.pdf

background
$ pdftk input.pdf background header.pdf output output.pdf

rotation right all
pdftk input.pdf cat 1-endright output output.pdf

refs

OSX10.11でのpdftkの導入

日本語説明されてる方
http://phasetr.com/blog/2016/07/28/2016-07-mac-osx-el-capitan-10-11-6-%E3%81%A7-homebrew-%E3%81%8B%E3%82%89%E5%85%A5%E3%82%8C%E3%81%9F-pdftk-%E3%81%8C%E5%8B%95%E3%81%8B%E3%81%AA%E3%81%84%E5%95%8F%E9%A1%8C%E3%81%AE%E8%A7%A3%E6%B1%BA/

参照先
http://stackoverflow.com/questions/32505951/pdftk-server-on-os-x-10-11

ダウンロード先
https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg

cpdfという解決方法もあるらしい(今回は試してない)
http://qiita.com/sekizo/items/fa63b00d0d110423426d

pdftkコマンド

http://nwpct1.hatenablog.com/entry/2013/12/14/192914
http://www.slab.ces.kyutech.ac.jp/~saitoh/ja/pdftk.html

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away