aboutsummaryrefslogtreecommitdiff
path: root/stamp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'stamp.sh')
-rwxr-xr-xstamp.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/stamp.sh b/stamp.sh
new file mode 100755
index 0000000..67cc848
--- /dev/null
+++ b/stamp.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+input=$1
+watermark=$2
+output=$3
+abl=/tmp/all_but_first.pdf
+first=/tmp/first.pdf
+first_stamped=/tmp/first_stamped.pdf
+
+# detach
+pdftk $1 cat 2-r1 output $abl
+pdftk $1 cat 1 output $first
+#Stamp
+pdftk $first stamp $watermark output $first_stamped
+#Attach
+pdftk $first_stamped $abl cat output $output