Skip to content

Commit

Permalink
Revert "Remove Ghostscript distillation"
Browse files Browse the repository at this point in the history
This reverts commit 10b5ed9.
  • Loading branch information
jxu committed Aug 6, 2022
1 parent 41de099 commit c4249ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Requirements
- chromium-browser
- [pup](https://github.com/ericchiang/pup)
- ImageMagick
- Ghostscript 9.21+ (older versions produce [skipped characters](https://stackoverflow.com/questions/12806911/ghostscript-skips-characters-when-merging-pdfs); still check carefully for any issues)
- Ghostscript


Example Usage
Expand Down
6 changes: 5 additions & 1 deletion download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ for i in $(seq -f "%03g" "$1" "$2"); do
[ "$(stat -c "%s" "$i.pdf")" -gt 10000 ] && break
done

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

# download html, download extra txt and gif files if available
curl -sS "$problem_url" > "$tmp_html"
pupcurl 'a attr{href}' '\.txt$' < "$tmp_html"
Expand All @@ -44,7 +48,7 @@ done
# combine all PDFs using gs
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite \
-dPDFSETTINGS=/ebook \
-sOutputFile=problems.pdf ./*.pdf
-sOutputFile=problems.pdf ./*_gs.pdf
# create final zip
zip problems.zip problems.pdf ./*.txt ./*.gif

0 comments on commit c4249ef

Please sign in to comment.