blob: 9341aeac310b62d9c7a79c8ad9b8acac0478930c [file] [log] [blame]
#!/bin/sh -eu
in=$1 out=$2 page0=${3:-} page1=${4:-$page0}
google-chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-startup-window --disable-gpu --run-all-compositor-stages-before-draw --no-pdf-header-footer --print-to-pdf="$out" "$in"
GS_ARGS=
if [ -n "$page0" ]; then
GS_ARGS="-dFirstPage=$page0 -dLastPage=$page1"
fi
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH $GS_ARGS -sOutputFile="$2.tmp" "$2"
mv "$2.tmp" "$2"