~carloabelli/bin

30feafa997c189cee894b51ca99b02ffc279e544 — Carlo Abelli 9 months ago 026d6c5
delete pages2pdf
1 files changed, 0 insertions(+), 21 deletions(-)

D pages2pdf
D pages2pdf => pages2pdf +0 -21
@@ 1,21 0,0 @@
#!/bin/sh

while getopts "o:" opt; do
    case $opt in
        o)
            out="$OPTARG"
    esac
done
shift $((OPTIND-1))

if [ "$#" -ne 1 ]; then
    echo "usage: $0 [-o file] file"
    exit 1
fi

in="$1"
[ -z "$out" ] && out="$in.pdf"

dir="$(mktemp -d)"
unzip "$in" -d "$dir" && mv "$dir/QuickLook/Preview.pdf" "$out"
rm -rf "$dir"