aboutsummaryrefslogtreecommitdiff
path: root/stamp.sh
diff options
context:
space:
mode:
authorFranciszek Malinka <franciszek.malinka@gmail.com>2022-07-17 14:28:05 +0200
committerFranciszek Malinka <franciszek.malinka@gmail.com>2022-07-17 14:28:05 +0200
commitff2588f19feb1ef9f1ac03bda3dbba858992032f (patch)
treed2c8e2dfb875850db4a79db6fd8b09daaf82cf03 /stamp.sh
parent1b211afb3945470eb40c7babb0b26349cec4fbf8 (diff)
Final (I hope so)
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