Browse Source

[nb] Edit: cli_commands.md

master
rdrew 2 weeks ago
parent
commit
d09ef138cb
  1. 47
      cli_commands.md

47
cli_commands.md

@ -33,11 +33,46 @@ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
(batch) (batch)
for f in *.PDF; do # In the folder with your PDFs
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \ mkdir downsampled
for f in *.pdf *.PDF; do
[ -f "$f" ] || continue
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen \
-dNOPAUSE -dBATCH \ -dNOPAUSE -dBATCH \
-dDownsampleColorImages=true -dColorImageResolution=72 \ -sOutputFile="downsampled/${f%.pdf}_72dpi.pdf" \
-dDownsampleGrayImages=true -dGrayImageResolution=72 \ "$f"
-dDownsampleMonoImages=true -dMonoImageResolution=72 \ done
-sOutputFile="output_pdfs/$f" "$f" # In the folder that contains your original PDFs
mkdir -p downsampled
for f in *.pdf *.PDF; do
[ -f "$f" ] || continue
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen \
-dNOPAUSE -dBATCH -dQUIET \
-sOutputFile="downsampled/$f" \
"$f"
done
# check current dpi
for f in *.pdf *.PDF; do
echo "=== Images in: $f ==="
pdfimages -list "$f"
echo ""
done
# Creates (or overwrites) images_list.txt in the current directory
for f in *.pdf *.PDF; do
if [ -f "$f" ]; then
echo "=== Images in: $f ===" >> images_list.txt
pdfimages -list "$f" >> images_list.txt
echo "" >> images_list.txt
fi
done
# scan for ccitt encoding
for f in *.pdf *.PDF; do
[ -f "$f" ] || continue
if pdfimages -list "$f" 2>/dev/null | grep -q " ccitt "; then
echo "$f uses CCITT"
fi
done done

Loading…
Cancel
Save