Friday, November 6, 2026 · Asia/KarachiFree tools · No signup · Runs in your browser

PDF Compressor

A photo PDF is a different problem from a text PDF. photo-page.pdf is one page, 900 by 600 points, filled by a JPEG that was saved at quality 95. The JPEG rebuild at quality 40 and scale 1 brought that file from 177.2 KB down to 23.7 KB. The page count stayed 1. pdf.js drew the page, the canvas encoded a new JPEG, and pdf-lib placed that JPEG on a page of the same size. The extracted text of the new file is (none), which is the honest result: there is no text operator left to copy.

New

A JPEG rebuild makes a picture of every page, so text can no longer be selected. Savings depend on the file: scanned pages usually shrink, and a page that is already a small image may not. Repack only keeps text selectable and does not recompress images.

How to use

  1. Open photo-page.pdf when you want the JPEG rebuild.
  2. Choose repack for report-a4-3pages.pdf when the letters must stay searchable.
  3. Read both the kilobyte line and the extracted-text line before you keep the download.

Formula / how it works

A photo PDF is a different problem from a text PDF. photo-page.pdf is one page, 900 by 600 points, filled by a JPEG that was saved at quality 95. The JPEG rebuild at quality 40 and scale 1 brought that file from 177.2 KB down to 23.7 KB. The page count stayed 1. pdf.js drew the page, the canvas encoded a new JPEG, and pdf-lib placed that JPEG on a page of the same size. The extracted text of the new file is (none), which is the honest result: there is no text operator left to copy.

The repack of report-a4-3pages.pdf is the other method. Three A4 pages went in and three A4 pages came out. The size stayed 1.3 KB, and the line on the page says the repack was not smaller. The extracted text is still "report-a4-3pages.pdf page 1". That string is how you know the letters survived. Repack turns on object streams. It does not resample images. A scan that is already a JPEG inside the PDF will barely move.

People ask for one "compress" button because desktop tools hide this choice. Hiding it here would mean claiming a text contract is now a photo, or claiming a scan got smaller when only the file wrapper changed. The method menu is the choice. JPEG rebuild is the one that changes pixels. Repack is the one that keeps a search box working.

Scale 1 draws at 72 pixels per inch. Scale 2 draws twice that and the JPEG gets heavier. Quality 40 is a hard squeeze, which is why the photo page shrank. Quality 80 keeps more edges and saves less. A page of black text on white, rebuilt as a JPEG, often grows, because a JPEG is a poor way to store a sharp letter. Use repack for that file, or leave it alone.

Nothing in this pass sends the PDF anywhere. The worker that pdf.js uses is loaded with this page, not with the text tools. A password prompt stops the run. pdf-lib cannot unlock a file, and this page will not pretend it can. Annotations, links and form fields are not rebuilt in the JPEG path, because a picture has none of those. The repack copies the page objects pdf-lib knows how to copy.

If you need the pages as separate files after a shrink, the splitter can zip them. If you need one page as a JPEG outside the PDF, the PDF to JPG page renders a single page without wrapping it up again. Merge, on the other hand, copies pages and does not draw them, so it will not shrink a scan either.

The PDF to JPG page renders a single page when you do not want a new PDF. PDF merge copies pages and will not shrink a scan.

Worked examples

Photo page rebuilt as JPEG

Inputs: pc-f: photo-page.pdf | pc-mode: jpeg | pc-q: 40 | pc-scale: 1

On this page, take photo-page.pdf, then jpeg, then 40, then 1 and press Compress PDF. Confirm the extracted-text line before you replace the original PDF.

Result: JPEG rebuild: 1 page at quality 40 and scale 1. Original 177.2 KB, output 23.7 KB. Each page is now a picture, so text cannot be selected or searched. Extracted text: (none) A scanned page usually shrinks. A page that is already a small image, or a short text page, may not.

Three text pages repacked

Inputs: pc-f: report-a4-3pages.pdf | pc-mode: repack | pc-q: 40 | pc-scale: 1

On this page, take report-a4-3pages.pdf, then repack, then 40, then 1 and press Compress PDF. Confirm the extracted-text line before you replace the original PDF.

Result: Repack only: 3 pages. Original 1.3 KB, output 1.3 KB. The repack was not smaller. Text stays selectable. Extracted text: report-a4-3pages.pdf page 1 Images are not recompressed, so a photo or a scanned page often stays about the same size.

Use cases

  • Shrinking the 900 by 600 photo page from 177.2 KB.
  • Proving a three-page A4 text file did not get smaller by repacking.
  • Refusing to call a picture of a page "still searchable".
  • Leaving password-locked PDFs closed on this compressor.

Tips & limitations

  • Quality 40 on the photo page is the harsh setting that reached 23.7 KB.
  • Scale 1 keeps the page at 72 pixels per inch in the JPEG rebuild.
  • Object streams in the repack do not resample the JPEG that is already inside a scan.
  • If extracted text says (none), the letters are paint.

FAQ

Why did the photo page fall from 177.2 KB to 23.7 KB?

pdf.js painted the page and a quality-40 JPEG replaced the quality-95 image that filled the 900 by 600 page.

Why did the three-page report stay 1.3 KB?

Repack only rewrites objects. Those three A4 pages were already tiny, and the extracted line is still report-a4-3pages.pdf page 1.

Does the JPEG rebuild keep a text search?

No. The extracted text line is (none) because the page is a picture.

Does repack recompress a scanned photo?

No. Images are copied. A scan usually stays about the same size.

Where is scale 2 useful?

When you want a sharper picture and you accept a heavier JPEG. This sample used scale 1.

What happens with a password?

The compressor stops. The locked bytes are not posted anywhere.

The 23.7 KB figure belongs to photo-page.pdf at quality 40. A different scan can shrink less or grow.