arduino-comic-fr/pdf.sh
2024-05-16 22:26:22 +02:00

26 lines
526 B
Bash
Executable File

#!/bin/bash
# Requires imagemagick and poppler-utils
# Configuration required to /etc/Image-magick-N/policy.xml
# add: <policy domain="coder" rights="read | write" pattern="PDF" />
APP_PATH=$( cd $(dirname $0) && pwd)
PDF_FILENAME="Arduino-comic-fr.pdf"
set -eou --pipefail
cd "$APP_PATH"
for f in $(cd svg && ls *svg); do
echo "Converting file $f..."
convert -density 200 svg/$f pdf/${f/svg/pdf}
done
echo "Consolidating PDF files..."
pdfunite pdf/* "$PDF_FILENAME"
echo "Successfully updated $PDF_FILENAME"