Added merge-pdf

This commit is contained in:
ByteDream 2021-05-20 08:06:50 +02:00
parent df6f1dcf39
commit 1aeb7ebb77
2 changed files with 29 additions and 0 deletions

7
merge-pdf/README.md Normal file
View File

@ -0,0 +1,7 @@
## Merge readme
Just a simple command line tool to merge multiple pdf files
#### Requirements
- `ghostscript`

22
merge-pdf/merge-pdf.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
while getopts ":o:output:" opt; do
case $opt in
o | output)
output=$OPTARG
;;
*)
echo "Unsupported argument was given (only '-o' is allowd)"
exit 1
;;
esac
done
shift $((OPTIND -1))
if [ -z $output ]; then
echo "An output must be provided ('-o' flag)"
exit 1
fi
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$output "${@}"