• Desktop freeware to SHRINK (aka optimize) PDFs

    From Bernhard Kleine@21:1/5 to All on Mon Nov 18 18:26:54 2019
    XPost: alt.os.linux

    Am 14.11.2019 um 01:09 schrieb Arlen Holder:
    Do you know of good desktop freeware to optimize (aka shrink PDF size?

    I noticed this old listing accidentally omits pdf shrinking/optimizing:
    o Please improve this listing of available freeware PDF functionality <https://groups.google.com/d/msg/alt.comp.freeware/iB5aOor0-Kw/hzoJDDjADQAJ>

    In an mobile OS thread today, someone asked for shrink/optimize methods
    where I pointed that user to our threads on freeware editing & removing permissions of PDFs.
    o PDF Shrinker, by John McWilliams <https://groups.google.com/d/msg/misc.phone.mobile.iphone/9dPChJVDakk/gnjZ1hWTAwAJ>

    It occurred to me while I was writing up a purposefully helpful response to that query that I always optimize PDFs (aka shrink PDFs) using the Adobe Writer (usually version 6 or 7) specific pulldown menu for shrinking PDFs, which allows us to optimize for any desired version of PDF.

    But that's payware.
    Since I have the writer, I have never looked for PDF optimizer freeware.

    Do you know of good desktop freeware to shrink (aka optimize) PDF size?


    I use the following ghostscript for windows:

    Z:\"Program Files"\gs\gs9.50\bin\gswin64 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dPrinted=false -dPassThroughJPEGImages=false -dDownsampleColorImages=true -dColorImageResolution=400 -dDownsampleGrayImages=true -dGrayImageResolution=400 -dDownsampleMonoImages=true
    -dMonoImageResolution=400 -dNOPAUSE -dBATCH
    -sOutputFile=file_Compressed.pdf file.pdf

    for the book with some 500+ images the original pdf has 1.6 GB, the
    compressed on some 60 Mb.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Allodoxaphobia@21:1/5 to Bernhard Kleine on Mon Nov 18 19:16:46 2019
    XPost: alt.os.linux

    On Mon, 18 Nov 2019 18:26:54 +0100, Bernhard Kleine wrote:
    Am 14.11.2019 um 01:09 schrieb Arlen Holder:
    Do you know of good desktop freeware to optimize (aka shrink PDF size?

    I noticed this old listing accidentally omits pdf shrinking/optimizing:
    o Please improve this listing of available freeware PDF functionality
    <https://groups.google.com/d/msg/alt.comp.freeware/iB5aOor0-Kw/hzoJDDjADQAJ> >>
    In an mobile OS thread today, someone asked for shrink/optimize methods
    where I pointed that user to our threads on freeware editing & removing
    permissions of PDFs.
    o PDF Shrinker, by John McWilliams
    <https://groups.google.com/d/msg/misc.phone.mobile.iphone/9dPChJVDakk/gnjZ1hWTAwAJ>

    It occurred to me while I was writing up a purposefully helpful response to >> that query that I always optimize PDFs (aka shrink PDFs) using the Adobe
    Writer (usually version 6 or 7) specific pulldown menu for shrinking PDFs, >> which allows us to optimize for any desired version of PDF.

    But that's payware.
    Since I have the writer, I have never looked for PDF optimizer freeware.

    Do you know of good desktop freeware to shrink (aka optimize) PDF size?


    I use the following ghostscript for windows:

    Z:\"Program Files"\gs\gs9.50\bin\gswin64 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dPrinted=false -dPassThroughJPEGImages=false -dDownsampleColorImages=true -dColorImageResolution=400 -dDownsampleGrayImages=true -dGrayImageResolution=400 -dDownsampleMonoImages=true -dMonoImageResolution=400 -dNOPAUSE -dBATCH
    -sOutputFile=file_Compressed.pdf file.pdf

    for the book with some 500+ images the original pdf has 1.6 GB, the compressed on some 60 Mb.

    I can confirm that Bernhard's gs script works un-changed on Ubuntu 14.04.
    It is great for compressing those User Manual PDFs for cameras and iToys
    which I load on my tablet for reference when I travel.

    Save it as a shell script:

    gs -sDEVICE=pdfwrite \
    -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dPrinted=false \ -dPassThroughJPEGImages=false -dDownsampleColorImages=true \ -dColorImageResolution=400 -dDownsampleGrayImages=true \ -dGrayImageResolution=400 -dDownsampleMonoImages=true \ -dMonoImageResolution=400 -dNOPAUSE -dBATCH \
    -sOutputFile=$1.shrunk.pdf $1

    It cut one camera User Manual in half, and a second camera User Manual to 1/3.

    Strangely, it TRIPLED the size of "Linux-101-Hacks.pdf"

    Thanks, Bernhard!!
    Jonesy
    --
    Marvin L Jones | Marvin | W3DHJ.net | linux
    38.238N 104.547W | @ jonz.net | Jonesy | FreeBSD
    * Killfiling google & XXXXbanter.com: jonz.net/ng.htm

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ken@21:1/5 to All on Mon Nov 18 19:28:14 2019
    XPost: alt.os.linux

    In article <qquk8v$ofl$1@tota-refugium.de>, bbfk@gmx.net says...

    I use the following ghostscript for windows:

    Z:\"Program Files"\gs\gs9.50\bin\gswin64 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dPrinted=false -dPassThroughJPEGImages=false -dDownsampleColorImages=true -dColorImageResolution=400 -dDownsampleGrayImages=true -dGrayImageResolution=400 -dDownsampleMonoImages=true -dMonoImageResolution=400 -dNOPAUSE -dBATCH
    -sOutputFile=file_Compressed.pdf file.pdf

    for the book with some 500+ images the original pdf has 1.6 GB, the compressed on some 60 Mb.


    If you've set DonsampleImages for all colour dpeths then setting PassThroughJPEGImages=false is redundant, because in order to downsample
    the images the image data must be decompressed and altered, so it
    *can't* be passed through untouched.

    You should never need to touch PassThroughJPEGImages, its best to leave
    it alone. It was originally intended so that people could disable it
    when the feature was new, in case it caused problems.


    Ken

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bernhard Kleine@21:1/5 to All on Sat Dec 14 07:52:50 2019
    XPost: alt.os.linux

    Am 18.11.2019 um 20:28 schrieb ken:
    In article <qquk8v$ofl$1@tota-refugium.de>, bbfk@gmx.net says...

    I use the following ghostscript for windows:

    Z:\"Program Files"\gs\gs9.50\bin\gswin64 -sDEVICE=pdfwrite
    -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dPrinted=false
    -dPassThroughJPEGImages=false -dDownsampleColorImages=true
    -dColorImageResolution=400 -dDownsampleGrayImages=true
    -dGrayImageResolution=400 -dDownsampleMonoImages=true
    -dMonoImageResolution=400 -dNOPAUSE -dBATCH
    -sOutputFile=file_Compressed.pdf file.pdf

    for the book with some 500+ images the original pdf has 1.6 GB, the
    compressed on some 60 Mb.


    If you've set DonsampleImages for all colour dpeths then setting PassThroughJPEGImages=false is redundant, because in order to downsample
    the images the image data must be decompressed and altered, so it
    *can't* be passed through untouched.

    You should never need to touch PassThroughJPEGImages, its best to leave
    it alone. It was originally intended so that people could disable it
    when the feature was new, in case it caused problems.


    Ken


    After one recent Ghostscript update my PDFs did not compress as before
    and I ask the GS people. Obviously this PassThroughJPEGImages=false is
    now necessary. The reason(s) for this I have not inquired and it is
    probably much to complicated for my mind.

    Regards Bernhard

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ken@21:1/5 to All on Sat Dec 14 09:08:39 2019
    XPost: alt.os.linux

    In article <qt20s3$ue6$1@tota-refugium.de>, bbfk@gmx.net says...

    After one recent Ghostscript update my PDFs did not compress as before
    and I ask the GS people. Obviously this PassThroughJPEGImages=false is
    now necessary. The reason(s) for this I have not inquired and it is
    probably much to complicated for my mind.

    Its pretty simple. JPEG works, in part, by throwing away detail, what is
    called 'lossy' compression.

    If you start with a JPEG file, decompress it, and then re-apply JPEG compression it throws away more detail resulting in a smaller size.

    Repeating this process over and over will result in very small files. Of course, they will be a featureless blur but if that's what you want.....

    Previously Ghostscript always decompressed JPEG images, and the default recompression was JPEG, so you got another pass of compression which
    reduced the quality. Users who cared about quality rather than file size
    had to apply more complex controls in order to prevent this happening,
    and still ended up with images which were larger than the originals.

    So if you don't change the colour model, and don't need to downample the
    images to a lower resolution, then the images remain untouched leading
    to better quality output.

    Instead of setting pass through false, you could instead change the DownsampleImages parameters. Or just turn off the pass through which is simpler, but you do need to understand the choices you are making; you
    are deliberately choosing to outptu lower quality images.

    Ken

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)