arduino-comic-fr/pdf.sh

32 lines
631 B
Bash
Executable File

#!/bin/bash
cat << EOF
# Caution:
#
# This script Requires
# apt install imagemagick poppler-utils ttf-mscorefonts-installer
#
# Configuration required to /etc/Image-magick-N/policy.xml
# add: <policy domain="coder" rights="read | write" pattern="PDF" />
EOF
APP_PATH=$( cd $(dirname $0) && pwd)
PDF_FILENAME="Arduino-comic-fr.pdf"
set -euo pipefail
cd "$APP_PATH"
mkdir -p "${APP_PATH}/pdf"
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"