답변:
미리보기에서 PDF를 열고 파일»다른 이름으로 저장… 을 선택한 다음 파일 크기 감소 라는 쿼츠 필터를 선택하십시오 .
ColorSync 유틸리티 를 사용 하여 필터를 미세 조정하십시오. 복제 파일 크기를 줄이고 나중에 설정을 변경하십시오.
저장할 양에 따라 150-300 DPI 정도 인 Resolution을 제외한 Image Sampling 블록 의 모든 값을 먼저 지우는 것이 좋습니다 .
Max Glenister & Milan Kupcevic 에서 영감을 얻음 , Burgi 덕분에 스크립트 예에 대한 설명 : ebook 필터를 사용하여 PDF 크기를 Massive에서 Small로 줄입니다.
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 옵션 :
-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)
멋진 솔루션을 제공해 주신 @ Mickaël에게 감사합니다.
> 기본 작업 및 도구에 대한 몇 가지 예 - - 나는 분할 페이지 제어 할 수있는 작은 개선을 만든 https://github.com/Elia-Sh/toolsAndUtils/blob/master/pdfSplit.sh을
파일을 저장하십시오-
#!/bin/bash
# inspired by:
# /superuser/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 $?