arduino-comic-fr/pdf.sh

32 lines
631 B
Bash
Raw Normal View History

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