Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #95667

Re: Shrinking huge PDF files

From Andreas Eder <a_eder_muc@web.de>
Newsgroups comp.os.linux.misc
Subject Re: Shrinking huge PDF files
Date 2026-11-15 10:50 +0100
Organization A noiseless patient Spider
Message-ID <87a4na779o.fsf@eder.anydns.info> (permalink)
References <Qq7KS.9052$s53.4981@fx10.iad>

Show all headers | View raw


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

Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Shrinking huge PDF files Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2026-11-15 00:56 +0000
  Re: Shrinking huge PDF files "Carlos E.R." <robin_listas@es.invalid> - 2026-11-15 02:16 +0100
    Re: Shrinking huge PDF files Nuno Silva <nunojsilva@invalid.invalid> - 2026-11-15 10:40 +0000
      Re: Shrinking huge PDF files "Carlos E.R." <robin_listas@es.invalid> - 2026-11-15 13:29 +0100
  Re: Shrinking huge PDF files Nuno Silva <nunojsilva@invalid.invalid> - 2026-11-15 01:28 +0000
  Re: Shrinking huge PDF files Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-11-15 01:49 +0000
  Re: Shrinking huge PDF files 🇵🇱Jacek Marcin Jaworski🇵🇱 <jmj@energokod.gda.pl> - 2026-11-15 03:26 +0100
  Re: Shrinking huge PDF files Rich <rich@example.invalid> - 2026-11-15 03:16 +0000
  Re: Shrinking huge PDF files Andreas Eder <a_eder_muc@web.de> - 2026-11-15 10:50 +0100
  Re: Shrinking huge PDF files Russell Marks <zgedneil@spam^H^H^H^Hgmail.com> - 2026-11-15 10:18 +0000
    Re: Shrinking huge PDF files Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2026-11-15 23:31 +0000
      Re: Shrinking huge PDF files c186282 <c186282@nnada.net> - 2026-11-15 22:16 -0500
        Re: Shrinking huge PDF files Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2026-11-16 05:04 +0000
          Re: Shrinking huge PDF files Mike Scott <usenet.16@scottsonline.org.uk.invalid> - 2026-11-16 07:09 +0000
            Re: Shrinking huge PDF files Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2026-11-16 17:02 +0000
              Re: Shrinking huge PDF files The Natural Philosopher <tnp@invalid.invalid> - 2026-11-16 18:17 +0000
          Re: Shrinking huge PDF files Rich <rich@example.invalid> - 2026-11-16 18:55 +0000
            Re: Shrinking huge PDF files c186282 <c186282@nnada.net> - 2026-11-16 21:29 -0500
            Re: Shrinking huge PDF files Nuno Silva <nunojsilva@invalid.invalid> - 2026-11-22 11:00 +0000
      Re: Shrinking huge PDF files "Carlos E.R." <robin_listas@es.invalid> - 2026-11-16 09:47 +0100
      Re: Shrinking huge PDF files Nuno Silva <nunojsilva@invalid.invalid> - 2026-11-16 08:56 +0000
        djvu [Was: Re: Shrinking huge PDF files] "Carlos E.R." <robin_listas@es.invalid> - 2026-11-16 11:15 +0100
          Re: djvu [Was: Re: Shrinking huge PDF files] Andy Burns <usenet@andyburns.uk> - 2026-11-16 13:18 +0000
            Re: djvu [Was: Re: Shrinking huge PDF files] Rich <rich@example.invalid> - 2026-11-16 19:00 +0000
              Re: djvu [Was: Re: Shrinking huge PDF files] Nuno Silva <nunojsilva@invalid.invalid> - 2026-11-23 00:13 +0000
                Re: djvu [Was: Re: Shrinking huge PDF files] "Carlos E.R." <robin_listas@es.invalid> - 2026-11-23 01:54 +0100
                Re: djvu [Was: Re: Shrinking huge PDF files] Andy Burns <usenet@andyburns.uk> - 2026-11-23 06:35 +0000
            Re: djvu [Was: Re: Shrinking huge PDF files] "Carlos E.R." <robin_listas@es.invalid> - 2026-11-17 03:00 +0100
          Re: djvu [Was: Re: Shrinking huge PDF files] Rich <rich@example.invalid> - 2026-11-16 18:59 +0000
        Re: Shrinking huge PDF files Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2026-11-16 17:02 +0000
          Re: Shrinking huge PDF files Rich <rich@example.invalid> - 2026-11-16 19:01 +0000
            Re: Shrinking huge PDF files Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2026-11-16 19:20 +0000
              Re: Shrinking huge PDF files Leroy H <lh@somewhere.net> - 2026-11-16 20:03 +0000
              Re: Shrinking huge PDF files Rich <rich@example.invalid> - 2026-11-16 22:04 +0000
                Re: Shrinking huge PDF files Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2026-11-17 02:00 +0000
          Re: Shrinking huge PDF files not@telling.you.invalid (Computer Nerd Kev) - 2026-11-17 07:25 +1000

csiph-web