aboutsummaryrefslogtreecommitdiffstats
path: root/cli/mergepdf.sh
blob: aef72db92fa19b13f42a361e3e5819589599c2e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
#
# Merge multiple PDFs with pdftk.
#
# Ref:
# Merging Multiple PDFs under GNU/Linux
# https://blog.dbrgn.ch/2013/8/14/merge-multiple-pdfs/
#
# Weitian LI
# 2015/01/23
#

if [ $# -lt 2 ]; then
    printf "Usage: `basename $0` out.pdf in1.pdf ...\n"
    exit 1
fi

outpdf="$1"
shift

echo "Input files: $@"
pdftk "$@" cat output "${outpdf}"