From 96ab7e2e00c29ec639018d4d8c8b827ede7c6d1b Mon Sep 17 00:00:00 2001 From: rdrew Date: Fri, 16 Jan 2026 15:13:13 -0400 Subject: [PATCH] [nb] Edit: cli_commands.md --- cli_commands.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cli_commands.md b/cli_commands.md index a3fe90e..78169e2 100644 --- a/cli_commands.md +++ b/cli_commands.md @@ -24,3 +24,20 @@ ocrmypdf --optimize 3 --skip-text input.pdf output.pdf ocrmypdf --optimize 3 --image-dpi 300 --output-type pdf \ --force-ocr --tesseract-pagesegmode 1 input.pdf output.pdf +# down sample pdfs to 72dpi +(single file) +gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \ + -dPDFSETTINGS=/screen \ + -dNOPAUSE -dQUIET -dBATCH \ + -sOutputFile=output.pdf input.pdf + +(batch) + +for f in *.PDF; do + gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \ + -dNOPAUSE -dBATCH \ + -dDownsampleColorImages=true -dColorImageResolution=72 \ + -dDownsampleGrayImages=true -dGrayImageResolution=72 \ + -dDownsampleMonoImages=true -dMonoImageResolution=72 \ + -sOutputFile="output_pdfs/$f" "$f" +done