ScanSnapにてA4サイズ32ページのカラー書類を600dpi設定で読み込むと、138MB程度のPDF (src.pdfとします) が生成されました。このままだと大きすぎて取り回しが悪いので、Windowsでサイズの縮小を試みました。用いたソフトはGhostscriptです。
GhostscriptはGhostscript: Ghostscript Downloads からインストールしました。バージョンは Ghostscript 9.23 for Windows (64 bit) です。
compression - How can I reduce the file size of a scanned PDF file? - Ask Ubuntu に5段階の縮小方法が記述されていたので、これを以下のバッチファイルで試します。
@echo off set PATH=%PATH%;"C:\Program Files\gs\gs9.23\bin" gswin64.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=01_screen.pdf src.pdf gswin64.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=02_ebook.pdf src.pdf gswin64.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=03_printer.pdf src.pdf gswin64.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=04_prepress.pdf src.pdf gswin64.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -sOutputFile=99_default.pdf src.pdf
Ghostcript PDF Reference & Tips — Milan Kupcevic によると、-dPDFSETTINGS
の各設定の意味は以下のとおりです。
-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)
バッチファイルを実行した結果得られたPDFのサイズは以下のようになりました。
設定 | サイズ |
---|---|
元PDF (src.pdf) | 138MB |
/screen | 3.1MB |
/ebook | 7.2MB |
/printer | 52MB |
/prepress | 74MB |
/default | 138KB |
/screen
, /ebook
を使った場合は画質があまりに荒く、とても見れたものではありませんでした。/printer
, /prepress
なら許容範囲だと感じました。
次に、より柔軟に圧縮率を指定したいと思い、compression - How to reduce the size of a pdf file? - Ask Ubuntu の回答を参考に、DPIを数値で指定しようとしたのですが、なぜか縮小されませんでした。一応以下にスクリプトを載せます。
@echo off set PATH=%PATH%;"C:\Program Files\gs\gs9.23\bin" gswin64.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=150.pdf src.pdf gswin64.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r300 -sOutputFile=300.pdf src.pdf gswin64.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r600 -sOutputFile=600.pdf src.pdf