On So 15 Nov 2026 at 00:56, Charlie Gibbs wrote:
> [Here's an on-charter post for a change...]
>
> I was given some scans of sheet music from an iPad vict^H^H^H^Huser who
> couldn't find the settings (if it has any) for its scanning function.
> As a result, she wound up with a 9-page PDF file that takes up over
> 30 megabytes. (When I scan a similar document on my machine the file
> is about one megabyte.) A bit of digging came up with utilities that
> tell me that her scan is in 24-bit colour at some ungodly resolution
> (using JPEG to keep it from being even bigger).
>
> I've been looking at utilities like Ghostscript, but the documentation
> is making my eyes glaze over. Is there a guide that can help me
> re-sample the file, say to 300 dpi in monochrome?
What I do ro make pdfs smaller is the following:
# $1=input, $2=output
gs -q -dNOPAUSE -dBATCH \
-sDEVICE=pdfwrite \
-sOutputFile="$2" \
-r1200 \
-dAutoRotatePages=/None \
-dCompressFonts=true \
-dDetectDuplicateImages \
-dEmbedAllFonts \
-dPDFSETTINGS=/prepress \
-dPrinted=false \
$zdistill $zres \
-f "$1"
#
# -r1200 is to avoid rendering on a tiny canvas, which can trip
# heuristics of complicated fonts, as (relating to a Hans font) in:
# https://bugs.ghostscript.com/show_bug.cgi?id=701753
# -dAutoRotatePages since no, we do not want pages randomly rotated.
# -dCompressFonts seems not to hurt, and can save notable space.
# -dDetectDuplicateImages similarly.
# -dEmbedAllFonts usually but doesn't always work to embed fonts,
# except that if downscaling images with zres, have to override.
# -dPDFSETTINGS=/prepress needed for embedding with
# 45-2/watters-litigator/doc.pdf (tb140)
# -dPrinted=false is to preserve internal links within the pdf,
# notably for the cover/cover3 in our tb*complete.pdf:
# https://tex.stackexchange.com/questions/456896
For grayscale output, can add
-sColorConversionStrategy=Gray \
-dProcessColorModel=/DeviceGray \
You can find full notes (e.g., options no longer used) and runnable scripts:
https://github.com/TeXUsersGroup/tugboat/blob/trunk/misc/ps2pdf-tub
https://github.com/TeXUsersGroup/tugboat/blob/trunk/misc/ps2pdf-gray-tub
Hope this helps,
'Andreas
--
ceterum censeo redmondinem esse delendam