Add pdf poster generation to ci pipeline
Change-Id: Ib18a3f2572d18e1f9dee7c4be83056040289a2b1
diff --git a/ci/html2pdf b/ci/html2pdf
new file mode 100755
index 0000000..1744ebf
--- /dev/null
+++ b/ci/html2pdf
@@ -0,0 +1,11 @@
+#!/bin/sh -eu
+in=$1 out=$2 page0=${3:-} page1=${4:-$page0}
+${CHROME:-chromium-browser} --no-sandbox --headless --disable-gpu \
+ --run-all-compositor-stages-before-draw --print-to-pdf-no-header \
+ --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"