mirror of
https://github.com/bytedream/scripts.git
synced 2025-06-03 07:30:56 +02:00
Added merge-pdf
This commit is contained in:
parent
df6f1dcf39
commit
1aeb7ebb77
7
merge-pdf/README.md
Normal file
7
merge-pdf/README.md
Normal 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
22
merge-pdf/merge-pdf.sh
Executable 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 "${@}"
|
Loading…
x
Reference in New Issue
Block a user