How it works
Upload, enhance, preview, download — with real processing at every step. Here is what happens between those four words.
1. The file is read, not uploaded
When you pick a file, the browser hands the application a reference to it. The bytes are read into memory in the tab and parsed with pdf.js, the same open-source PDF engine Firefox uses to display documents.
There is no network request carrying your document, because there is no server-side component to send it to. If you want to verify that, open your browser's developer tools, switch to the Network tab and process a file: you will see the application's own code and the PDF renderer being fetched, and nothing leaving with your data.
2. Each page is classified
Pages are not all the same kind of thing, and treating them as if they were is how most tools damage documents.
Each page is inspected for two properties: how much extractable text it contains, and whether it paints any bitmaps. A page with real text and no images can be darkened losslessly. A page that paints images is, for our purposes, a scan, and has to be enhanced as one.
3a. Text pages: colour operators are rewritten
A PDF page stores its content as a stream of drawing operators, and colour is set by specific instructions in that stream — a grey value, an RGB triple, a CMYK quadruple.
For a text page, that stream is parsed and only those colour instructions are rewritten. Everything else — glyphs, fonts, positions, vector paths, links, structure — is copied byte for byte. A 55% grey becomes near black; a light grey background rectangle becomes white; a coloured logo is darkened more gently and keeps its hue.
Because nothing is rasterised, the text stays selectable, searchable and sharp at any zoom, and the file stays roughly the size it was.
3b. Scanned pages: measured, corrected, re-toned
- The page is rendered at 150 DPI, with a cap on total pixels so a very large page cannot exhaust the device's memory.
- A histogram is built from a strided sample of the page. The 95th percentile becomes the paper level; the mean of everything meaningfully darker than the paper becomes the ink level.
- The paper level is then estimated locally, on a grid across the page, and smoothed. Dividing each pixel by its local paper level removes shadows, gradients and colour casts.
- A 3×3 median filter is applied only to pixels on the paper side of the histogram, removing speckle and dust without rounding the corners of small text.
- A tone curve is built: black point at the measured ink level, white point at the measured paper level, with a gamma curve and a smooth S-curve between them.
- A mild unsharp mask restores the edge definition that the scanner optics and JPEG compression softened.
- Pixels are written back. Anything genuinely saturated keeps its hue and is darkened more gently, so signatures, stamps and logos survive.
4. Auto Print Enhance decides how much to apply
In Auto mode the numbers from step 3b drive the settings rather than a fixed preset. Three measurements matter: how faint the ink is, how grey the paper is, and how compressed the tonal range is.
A page that scores low on all three is already good, and gets a very light touch — that is the safeguard against degrading a document that did not need help. A page that scores high on all three gets the full correction. Everything in between gets something proportionate.
A page that is predominantly dark — white text on black, a dark slide — is detected separately and left almost alone, since "darkening" it would erase it.
5. The heavy work runs off the main thread
Measuring and re-toning several million pixels per page would freeze the interface if it ran where the interface does. The pixel work runs in a Web Worker instead, and buffers are transferred rather than copied, so the progress indicator keeps moving and the page stays responsive.
6. A new PDF is written
The output is assembled with pdf-lib. When every page had to be rasterised, a brand new document is created from the enhanced images — the original, often very large, scanned images are not carried across, which keeps the file size sensible.
When the document contains text pages, a copy of the original is modified in place instead, so those pages keep their real text, fonts and structure while any scanned pages are replaced.
Your original file is never written to. The result is saved under a new name, such as `invoice-print-ready.pdf`.
7. The preview is a real render
The before/after slider does not apply a CSS filter to fake a darker look. Both sides are rendered from actual PDFs — the original file on one side, the finished output on the other — using the same renderer at the same size.
What you see in the slider is what the file contains.
Current limits
- File size
- 50 MB
- Pages
- 100
- Raster resolution
- 150 DPI
Because the work happens on your own device, the practical ceiling is really its memory. These limits exist so you get a clear message instead of a crashed tab.