A form wants your certificates as a PDF under 200 KB. The scanner gives you several megabytes. You run it through a "compress PDF" tool and it comes out barely smaller. You try another one. Same thing.
The tools usually aren't broken. A scan just doesn't shrink the way they're trying to shrink it.
What's actually inside a scanned PDF
A PDF exported from Word is mostly text: instructions that say "draw these letters in this font here". That's tiny. A scanned PDF is one big picture per page, wrapped in a PDF. There's no text in it at all, only pixels of what text looked like.
You can see this with pdfimages from poppler-utils:
pdfimages -list scan.pdf
To test everything in this post, I made a two-page stand-in for a scan: A4 at 300 dpi, a slightly grey paper texture with grain, and a few lines of text, saved as JPEG pages in a PDF. It came to 8,083,239 bytes, and pdfimages -list showed what's inside:
page num type width height color comp bpc enc ... x-ppi y-ppi size
1 0 image 2480 3508 rgb 3 8 jpeg ... 300 300 3946K
2 1 image 2480 3508 rgb 3 8 jpeg ... 300 300 3945K
2480 x 3508 pixels is A4 at 300 dpi, and almost all of the file is those two images.
Why "compress PDF" does nothing to it
Many compressors start with a lossless rewrite: tidy the PDF structure, drop metadata, recompress streams that aren't already compressed. That works well on a text PDF. On a scan the images are already JPEG, and you can't losslessly squeeze a JPEG much further.
I checked this with Ghostscript, telling it to pass the JPEGs through untouched. My 8,083,239 byte file came out at 8,083,217 bytes. Twenty-two bytes saved.
To shrink a scan, you have to make the images themselves smaller: fewer pixels, lower JPEG quality, or both.
The best fix: scan it smaller to begin with
If you can rescan, do. It gives a cleaner result than shrinking afterwards.
- Resolution: for a document that only needs to be read on screen, 150 to 200 dpi is usually enough. 300 dpi and above is for printing or archiving.
- Colour mode: grayscale for anything black and white. Colour only when colour matters, like a stamp or a photo.
- Crop to the page. A scanner bed is bigger than A4, and the margin is wasted pixels.
Check your form's instructions first, though. Some specify a minimum resolution or require colour, and that overrides anything here.
Phone scanning is often easier. On Android, the Google Drive app has a Scan option. On iPhone, the Notes app and the Files app both have Scan Documents. They straighten and crop the page and save a PDF. Look at the file size before you upload, because it depends on the app's settings.
Shrinking an existing scan with Ghostscript
If rescanning isn't possible, Ghostscript (free, on Linux, macOS via Homebrew, and Windows) can downsample the images inside the PDF:
gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook \
-dNOPAUSE -dBATCH -dQUIET \
-sOutputFile=scan-small.pdf scan.pdf
/ebook brings images down to 150 dpi and re-encodes them as JPEG. On my test file that took 8,083,239 bytes down to 114,123 bytes, and pdfimages -list now shows each page as 1240 x 1754 pixels at 150 dpi, about 54K each.
You can also convert to grayscale:
gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook \
-sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray \
-dNOPAUSE -dBATCH -dQUIET \
-sOutputFile=scan-gray.pdf scan.pdf
On my test file this didn't help: it came out at 117,623 bytes, slightly bigger than the colour version, because the "colour" pages were nearly grey already. On a scan with real colour in it, a coloured background or a blue pen, it's worth trying. Just measure rather than assume.
If /ebook still isn't small enough, /screen goes down to 72 dpi. My test file dropped to 58,593 bytes, and the large text was still readable, but at 72 dpi small print and fine detail break down quickly. Always open the result and zoom in on the smallest text before you upload it.
What Ghostscript doesn't do is aim at a number. If /ebook gives you 230 KB, there's no "make it 200 KB" switch. You can set the image resolution yourself, but the size doesn't always move the way you'd expect: on my test file, forcing 120 dpi with -dColorImageResolution=120 came out at 145,291 bytes, bigger than the 150 dpi /ebook result. I haven't pinned down why, and that's the point: whatever you change, measure the output again.
Do the per-page maths
200 KB across five pages is roughly 40 KB per page. Each page is now a 40 KB photo of an A4 sheet. That can be readable, but small print starts to blur.
So cut what you don't need before compressing:
- Drop blank pages. The back of a single-sided certificate still costs bytes if the scanner captured it.
-
Send only the pages they asked for. If the form wants one marksheet, not the whole transcript, extract those pages first. With qpdf that's
qpdf scan.pdf --pages . 1,3 -- needed.pdf, and Ghostscript can do it with-dFirstPage=1 -dLastPage=1.
Fewer pages means each page gets more of the budget, and the result is noticeably sharper.
Check what "200 KB" means
Some forms mean 200,000 bytes and some mean 204,800 (200 x 1024). Your file manager may show either. If you're close to the line, aim a bit under, say 195 KB, and don't spend an afternoon on the last 4 KB.
The gotcha
Some scanner apps add an invisible OCR text layer, so the scan is searchable. Heavy compression can drop or damage it, and any tool that redraws pages as images definitely drops it. Keep the original for your own records and treat the small file as the upload copy only. Name it something like marksheet-upload-200kb.pdf so you don't later send the blurry one to someone who needs the real thing.
I built ToolOcean, a set of browser-based file tools. Its compress-to-200 KB page treats the limit as 204,800 bytes, tries a lossless rewrite first, and if that won't fit, redraws each page as a JPEG at whatever quality gets under the ceiling and says so in the result note. The file stays in your browser tab: https://toolocean.co/compress-pdf-to-200kb
Drafted with AI help, tested and checked by me.
Top comments (0)