PDFを圧縮
PDFを小さくします。大きくなることはありません。
このツールはブラウザーの中だけで動きます。ファイルがアップロードされることはなく、そのことはブラウザーのネットワークタブでご自身で確認できます。 ご自分で確かめてください。ブラウザーのネットワークタブを開いて見てください。残りの作業回数を尋ねる小さなリクエストが1つだけ表示されます。ツール名とハッシュだけで、ファイルは決して含まれません。
このツールでできること
Two different things make a PDF smaller, and this tool does both in turn. The structural pass repacks the file's objects and recompresses its streams, which is lossless and usually saves 10 to 25 per cent on a document nobody has optimised before. The image pass re-encodes the pictures at a lower resolution, which is where the large reductions on a scan come from, and it is lossy. Both results are measured against the original, and if neither won you get your own file back rather than a slightly bigger one labelled compressed.
The trigger is almost always a limit somewhere else: a mail server that bounces attachments over 25 MB, an application portal that stops at 2 MB, or a 40 MB scanned contract that has to reach someone on a phone connection.
仕組み
- Drop the PDF onto this page. Files up to 300 MB are accepted.
- Pick a level. Light is structure only and changes nothing you can see; Balanced re-encodes images at 150 dpi; Strong drops to 100 dpi for getting a scan under an attachment limit.
- Choose Custom to set the numbers yourself - resolution between 72 and 300 dpi, quality between 30 and 95 per cent.
- Open advanced options if you also want the images turned grey, the metadata stripped, or a filled form flattened first. Each makes the file smaller.
- Press Compress. The result reports the size before and after, and how many pages were re-encoded.
The structural pass is qpdf rewriting the file with object streams, compressed cross-references and every flate stream recompressed at level 9. Nothing about the page content changes, so it always runs whatever level you picked. On a file that has already been through a good optimiser it saves nothing at all, which is a real outcome rather than a failure.
The image pass works by re-rendering. A browser cannot reach inside a PDF and re-encode the pictures in place, so every page is drawn at the resolution you chose and written back as a JPEG. That would normally cost you the text, so the text is read out with PDF.js first and drawn back over the images in an invisible layer, keeping words selectable and searchable. What this route cannot carry across is links, form fields and annotations - if you need those, use Light.
The rule this tool will not break is that it never hands back a bigger file. An already-optimised document, and one whose images are stored more efficiently than a fresh JPEG of the same page, both genuinely come out larger. When that happens the original bytes are returned untouched and the result says the file was already optimised, because a compressor that grows your file and reports success is worse than no compressor.
Knowing where the size sits will save you a disappointment. In a scan it is the images, so Strong can take 40 MB to under 5 MB. In a text report it is the embedded fonts and the structure, so 10 to 20 per cent is a good result and re-encoding its few images changes very little.
Everything runs on your device. qpdf and PDF.js are compiled to WebAssembly and run in Web Workers, so a 300 MB scan is processed without a byte being sent anywhere.
このツールにできないこと
- Anything above Light re-encodes the images, which is lossy - fine print in a scan softens, and the loss cannot be undone from the output file.
- A document that has already been optimised may not shrink at all. In that case the original is returned unchanged and the result says so.
- When the image pass wins, the pages are rebuilt from pictures, so links, form fields and annotations are not carried over. The text layer is, invisibly.
よくある質問
- どのくらい小さくなりますか?
- 中身によります。スキャンしたドキュメントは画像なので、「バランス」で4分の1程度、「強め」で10分の1未満になることがよくあります。テキスト中心のドキュメントはフォントと構造でできていて、可逆の処理で10〜25パーセント減り、それ以上はあまり残っていません。結果には前後の両方の数値が表示されるので、もっと強いレベルを試すかどうか判断できます。
- ドキュメントの見た目はこれまでどおりですか?
- 「軽め」なら見た目はまったく同じです。変わるのはファイルの構造だけだからです。「バランス」では画像が150 dpiで再エンコードされ、画面では問題なく読め、印刷も実用的な品質です。「強め」の100 dpiはスキャンをよく見ると分かりますが、読む分には支障ありません。元のファイルを消す前に、結果を1ページ確認してください。
- まったく小さくならなかったのはなぜですか?
- すでに最適化されていたからです。最近のソフトで書き出したファイルや、一度圧縮ツールを通したファイルには、詰め直す余地が残っていません。わずかに大きくなったファイルを「成功しました」と返す代わりに、このツールは元のファイルをそのまま返し、その旨をお伝えします。
- 圧縮するとテキストが検索できなくなりますか?
- いいえ。画像の処理を行うときは、ページを差し替える前にテキストを取り出し、画像の上に見えない状態で描き直します。そのため選択・検索・コピーはそのまま使えます。この方法で失われるのはリンク・フォームの入力欄・注釈で、「軽め」が用意されているのはそのためです。
- 圧縮のためにファイルはアップロードされますか?
- いいえ。圧縮はブラウザーの中で行われ、qpdfとPDF.jsがWeb Worker上でWebAssemblyとして動きます。開発者ツールを開き、ネットワークタブに切り替えてから何か圧縮してみてください。外部への通信は1件も出ませんし、ページを読み込んだあとはオフラインでも動作します。
- メールの容量制限に収めるには、どのレベルを使えばいいですか?
- まず「バランス」で試し、表示されたサイズを見てください。まだ超えている場合は「強め」を、それでも足りない場合は詳細設定で画像のグレースケール化をオンにしてください。カラーのスキャンなら、そこからさらに3分の1ほど減るのが普通です。