
オンラインサービスに頼らずGhostscriptでPDFをコマンドラインから圧縮する
MacでGhostscriptをインストールする 準備としてbrewでghostscriptをインストールする。
$ brew install ghostscript GhostscriptでPDFを圧縮するコマンド 以下のコマンドで指定したPDFファイルを圧縮する。
$ gs -sDEVICE=pdfwrite \ -dCompatibilityLevel=1.4 \ -dPDFSETTINGS=/ebook \ -dNOPAUSE \ -q \ -dBATCH \ -sOutputFile=出力ファイルパス.pdf \ 入力ファイルパス.pdf 各オプションの説明 -sDEVICE 変換したい出力ファイル形式に応じたデバイスを選択する。