Libraries and licences
- pdf-lib 1.17.1, MIT licence: reads and writes the PDF structure.
- pdf.js 3.11.174, Apache-2.0 licence (Mozilla): renders pages for Smallest mode and previews.
- Space Grotesk, SIL OFL 1.1; Noto Nastaliq Urdu and Liberation Sans (Urdu Latin companion), SIL OFL 1.1. Licence files ship with the fonts.
How the sample files were made
A script (tests/make-samples.mjs in the repository) draws pages in a canvas: paper tone, a lighting gradient, lines of text, a stamp and random sensor noise, then saves them as JPEG (quality 90, 1654 x 2339 px, 200 DPI A4) and wraps them in PDFs with pdf-lib. The 30-page text document is made with standard Helvetica text. The mixed file is a typed cover page plus two scans. These are synthetic: noisy pages are a hard case, so real clean scans usually compress more.
All results
These are real runs of the code on this site, in desktop Chrome, on sample files we generated ourselves: a "phone scan" is a page drawn at 200 DPI with paper tone, uneven light, text lines and sensor noise, saved as a JPEG at quality 90 inside a PDF. Real scans vary: smoother pages compress better, noisier or very detailed pages worse. Treat the table as an example, not a promise. "Picture sharpness" is the approximate resolution of the pictures after compression (the samples start at 200 DPI); about 150 is crisp, about 100 is readable for normal print, below about 80 small text gets hard to read. The method is in Sources and tests.
| Test file | Original | Limit asked | Method | Result | Picture sharpness | Under the limit? | Time |
|---|---|---|---|---|---|---|---|
| 6-page phone scan | 9.49 MB | 500 KB | Keep text | 493 KB | ~80 DPI | Yes | 1.4 s |
| 6-page phone scan | 9.49 MB | 200 KB | Keep text | 146 KB | ~50 DPI | Yes | 1.3 s |
| 6-page phone scan | 9.49 MB | 100 KB | Keep text | 90 KB | ~40 DPI | Yes | 1.3 s |
| 6-page phone scan | 9.49 MB | 1.00 MB | Keep text | 856 KB | ~100 DPI | Yes | 1.9 s |
| 6-page phone scan | 9.49 MB | 500 KB | Smallest | 383 KB | ~72 DPI | Yes | 10.4 s |
| 6-page phone scan | 9.49 MB | 200 KB | Smallest | 152 KB | ~50 DPI | Yes | 10.9 s |
| 6-page phone scan | 9.49 MB | 100 KB | Smallest | 109 KB | ~42 DPI | No: closest it got | 4.8 s |
| 6-page phone scan | 9.49 MB | 100 KB | Smallest + grayscale | 109 KB | ~42 DPI | No: closest it got | 5.4 s |
| 2-page phone scan | 3.16 MB | 200 KB | Keep text | 165 KB | ~80 DPI | Yes | 0.8 s |
| Cover letter + 2 scans | 3.17 MB | 500 KB | Keep text | 437 KB | ~120 DPI | Yes | 0.8 s |
| Cover letter + 2 scans | 3.17 MB | 500 KB | Smallest | 432 KB | ~100 DPI | Yes | 3.8 s |
| 30-page text document | 48 KB | 20 KB | Keep text | 48 KB | unchanged | No: closest it got | 0.1 s |
| 30-page text document | 48 KB | 200 KB | Keep text | 48 KB | unchanged | Yes | 0.1 s |
Checks run on every result: page count and page size unchanged, never larger than the original, Keep text leaves the text layer in place on the text and mixed files, Smallest output has no text layer, and no network request carries file data. The images test also checks reordering and that a photo with an EXIF rotation tag comes out upright.
Portal rules we left out
The product plan listed FPSC, PPSC, SPSC, KPPSC, BPSC, NTS, HEC and IBCC upload rules to verify. We could not confirm any current limit from an official page we are allowed to quote, so none is published. Limits also change from one advertisement to the next. We would rather say nothing than give you a wrong number.
Units
KB is counted as 1,000 bytes and MB as 1,000,000 bytes (NIST and BIPM define the SI prefixes). See KB vs MB.