Reduzieren der PDF-Dateigröße

Ich habe ein paar Fotos gemacht und ein riesiges PDF davon auf Omnigraffle (OSX) gemacht.

Jetzt muss ich dieses PDF per E-Mail senden, aber da jedes Foto 5 MB groß ist, ist die Datei riesig. Ich brauche die hochauflösenden Fotos jedoch nicht, wenn ich sie per E-Mail verschicke.

Welches Programm nimmt meine PDF-Datei auf, ändert die Größe aller Bilder auf eine niedrige Auflösung und speichert sie?

 23
Author: themirror, 2011-06-07

5 answers

Öffnen Sie die PDF-Datei in der Vorschau, wählen Sie Datei " Speichern unter..., und wählen Sie die Quarzfilter mit dem Namen Dateigröße reduzieren.

geben Sie hier die Bildbeschreibung ein


Verwenden Sie das Dienstprogramm ColorSync , um den Filter zu optimieren. Duplizieren Sie Reduzieren Sie die Dateigröße und ändern Sie anschließend die Einstellungen.

Ich schlage vor, dass Sie zuerst versuchen, alle Werte aus dem Block Image Sampling zu löschen, mit Ausnahme der Auflösung , die bei 150 bis 300 DPI liegen sollte, je nachdem, wie viel Sie möchten speichern.

geben Sie hier die Bildbeschreibung ein

 26
Author: Daniel Beck,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2011-06-07 04:36:35

Inspiriert von Max Glenister & Milan Kupcevic, Dank Burgi, Erklärung des Beispielskripts: Es reduziert die PDF-Größe mit dem eBook-Filter von massiv auf klein

brew install ghostscript # aptitude work too if you do not have brew

compresspdf() {
    echo 'Usage: compresspdf [input file] [output file] [screen|ebook|printer|prepress]'
    gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=/${3:-"screen"} -dCompatibilityLevel=1.4 -sOutputFile="$2" "$1"
}

compresspdf "Massive.pdf" "Small.pdf" ebook

Gs-Optionen:

-dPDFSETTINGS=/screen   (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook    (low quality, 150 dpi images)
-dPDFSETTINGS=/printer  (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default  (almost identical to /screen)
 16
Author: Mickaël,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2017-06-11 09:07:21

Ich kenne kein Programm, das tut, was Sie wollen, aber eine Alternative, um das gleiche Endergebnis zu erzielen, wäre, die Bilder zuerst mit einem Grafikprogramm zu komprimieren und dann dann Legen Sie sie in ein Dokument und konvertieren Sie es in PDF.

 1
Author: goblinbox,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2011-06-07 03:27:04

Danke @Mickaël, für deine tolle Lösung,

Ich habe eine kleine Verbesserung erstellt, um die Aufteilungsseite zu steuern -> die Standardaktion und einige Beispiele für das Tool - https://github.com/Elia-Sh/toolsAndUtils/blob/master/pdfSplit.sh

Speichern Sie die Datei -

#!/bin/bash

# inspired by: 
#   https://superuser.com/questions/293856/reducing-pdf-file-size
#   https://www.ghostscript.com/doc/current/Use.htm#File_output

usage() {
    cat<<EOF
Usage:
    ${0} <input file> <output file> [screen|ebook|printer|prepress]

EOF
}
# Examples:
# Note: Ghostscript must be installed on your system
# Note that <n> represents the number of pages in the original document;

#     * Only split file to pages; no range available -
#         \$ ${0} someFile.pdf
#       will create the following single page files:
#         someFile_page_0001.pdf, someFile_page_0002.pdf someFile_page_0003.pdf, someFile_page_000<n>.pdf

#     * Split page to custom output file name -
#         \$ ${0} someFile.pdf newFileName_pageNumer_%2d.pdf
#       will create the following single page files:
#         newFileName_pageNumer_01.pdf, newFileName_pageNumer_02.pdf, newFileName_pageNumer_03.pdf, newFileName_pageNumer_0<n>.pdf

#     * Only reduce quality of pdf file !without! splitting -
#         \$ ${0} someFile.pdf newFileName.pdf ebook
#       will create the following single file: newFileName.pdf with reduced quality

#     * Reduce quality !and! split pdf to single pages -
#         \$ ${0} someFile.pdf newFileName_%2d.pdf ebook
#       will create the following single page files, with lower qualuty
#         newFileName_page_01.pdf, newFileName_page_02.pdf, newFileName_page_03.pdf, newFileName_page_0<n>.pdf

### main ###
DEFAULT_QUALITY="printer"
numberOfArguments=$#

case $numberOfArguments in
    1)
        # only split the file
        fileNameInput=$1
        fileNameOutput="${fileNameInput}_page_%04d.pdf"
        pdfSettings=$DEFAULT_QUALITY
        ;;
    2)
        # user supplied input and output files
        fileNameInput=$1
        fileNameOutput=$2
        pdfSettings=$DEFAULT_QUALITY
        ;;
    3)
        # user supplied input and output files
        fileNameInput=$1
        fileNameOutput=$2
        pdfSettings=$3
        ;;
    *)
    # incorrect syntax print usage and exit
        echo "Error: Illegal number of parameters."
        usage
        exit 1
    ;;
  esac

if [[ ! -f $fileNameInput ]]; then
    echo "Error: ${fileNameInput} not found!"
    exit 2
fi

if ! which gs > /dev/null 2>&1; then
    echo "Error: Looks like the Ghostscript package is not installed on your system."
    exit 3
fi

cmdToExecute="gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH \
    -dPDFSETTINGS=/$pdfSettings -dCompatibilityLevel=1.4 \
    -sOutputFile=$fileNameOutput $fileNameInput"

echo -e "Executing:\n    "$cmdToExecute

$cmdToExecute
# finish script with the return code from gs command
exit $?
 0
Author: Elia,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2019-07-02 06:09:48

Basierend auf @Mickaëls Antwort können Sie die PDF-Dateien auch in einem Docker-Container konvertieren, wenn Sie gs nicht mit all seinen Abhängigkeiten auf Ihrem Computer installieren möchten:

docker run --rm -v (pwd):/app -w /app minidocks/ghostscript -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -sOutputFile="/app/compressed.pdf" /app/source.pdf
 0
Author: KARASZI István,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2020-12-07 22:29:13