blob: 04dbac72e45538ee45cf3ee62f1c1ebf38832bea [file] [log] [blame]
Marc Kupietzce1aa0c2023-06-15 07:50:23 +02001#!/bin/sh -eu
2in=$1 out=$2 page0=${3:-} page1=${4:-$page0}
Marc K5e2f38e2023-06-15 11:56:36 +02003chromium-browser --headless --disable-gpu --no-sandbox --run-all-compositor-stages-before-draw --no-pdf-header-footer --print-to-pdf-no-header --print-to-pdf="$out" "$in"
Marc Kupietzce1aa0c2023-06-15 07:50:23 +02004GS_ARGS=
5if [ -n "$page0" ]; then
6 GS_ARGS="-dFirstPage=$page0 -dLastPage=$page1"
7fi
8gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH $GS_ARGS -sOutputFile="$2.tmp" "$2"
9mv "$2.tmp" "$2"