Skip to content

Commit

Permalink
Fix chromium rendering by virtual time budget (fixes #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jxu committed Aug 20, 2021
1 parent ed42e21 commit 1a0ea7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions download.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
for i in $(seq -f "%03g" $1 $2); do
URL="https://projecteuler.net/problem=$i"
# chromium print to PDF
chromium-browser --headless --disable-gpu --print-to-pdf-no-header --print-to-pdf=$i.pdf $URL
# chromium print to PDF, wait for rendering https://stackoverflow.com/a/49789027
chromium-browser --headless --disable-gpu --run-all-compositor-stages-before-draw --virtual-time-budget=10000 --print-to-pdf-no-header --print-to-pdf=$i.pdf $URL

# Distill PDFs to workaround Ghostscript skipped character problem https://stackoverflow.com/questions/12806911
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -o ${i}_gs.pdf $i.pdf
Expand Down

0 comments on commit 1a0ea7a

Please sign in to comment.