Marc Kupietz | e073034 | 2023-06-14 09:52:17 +0200 | [diff] [blame] | 1 | #!/bin/sh -eu |
2 | in=$1 out=$2 page0=${3:-} page1=${4:-$page0} | ||||
3 | ${CHROME:-chromium-browser} --no-sandbox --headless --disable-gpu \ | ||||
4 | --run-all-compositor-stages-before-draw --print-to-pdf-no-header \ | ||||
5 | --no-pdf-header-footer --print-to-pdf="$out" "$in" | ||||
6 | GS_ARGS= | ||||
7 | if [ -n "$page0" ]; then | ||||
8 | GS_ARGS="-dFirstPage=$page0 -dLastPage=$page1" | ||||
9 | fi | ||||
10 | gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH $GS_ARGS -sOutputFile="$2.tmp" "$2" | ||||
11 | mv "$2.tmp" "$2" |