commit 3f77e5f9773fb728e7c35d59f6f204482d19c6bc parent e9f2bfa22f43594235b8b963dc19cc19c9a23a73 Author: Sebastiano Tronto <sebastiano@tronto.net> Date: Wed, 2 Nov 2022 17:15:55 +0100 Added mergepdf Diffstat:
M | Makefile | | | 1 | + |
A | mergepdf | | | 18 | ++++++++++++++++++ |
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile @@ -18,6 +18,7 @@ SCRIPTS = addressgrep \ ffmpeg-screenrecord \ ffmpeg-facecam \ mail-compose \ + mergepdf \ notify-status \ open-file \ open-stdin \ diff --git a/mergepdf b/mergepdf @@ -0,0 +1,18 @@ +#!/bin/sh + +# Merge multiple pdf files into one +# Requires: gs +# Usage: mergepdf [-o outname] file1.pdf file2.pdf ... + +outname=merged.pdf + +while getopts "o:" opt; do + case "$opt" in + o) + outname="$OPTARG" + ;; + esac +done +shift `expr $OPTIND - 1` + +gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outname $@