Lyonite
Measured results

The PDF you just sent still has your first draft in it

You lowered a price, saved, and emailed the quote. The old price is still in that file — not in a backup, in the PDF sitting in someone's inbox. Most tools that claim to clean a PDF never touch it. I planted four old drafts in one file and ran it through five cleaners.

Tested by Rajgursher Singh, developer at Lyonite.

Tested 6 September 2026, 11:14 PM EDT. Fixture generator and checker published.

What I planted

One PDF. Saved five times, with a different author and title each time.

  • Save 1 — Jane Doe, "Draft one"
  • Save 2 — "Draft two", marked Internal only
  • Save 3 — author changes to Priya Raman, "Draft three"
  • Save 4 — "Final", marked confidential, written on Reviewer Workstation 4

Open that file and it says Priya Raman wrote something called Final. Search its raw bytes and Jane Doe is still in there, with all three earlier titles.

That is not a trick I played on the file. It is what saving a PDF normally does.

Why the old version is still in there

Changing one word in a PDF does not rewrite the file. The reader appends the new version to the end and leaves the old one where it was.

It nearly has to. Rewriting an 80 MB file to fix a typo would be slow, and appending is what lets a digital signature stay valid — the signed bytes are never disturbed.

So nothing gets deleted. The old version is still sitting in the same place in the file. It is simply no longer pointed at.

Save four times and you are carrying four old versions.

Why nothing you check with will show you

Open the file in any reader and you see the final draft. That is correct behaviour — the newest version *is* the document.

So every tool agrees with every other tool, and all of them are looking at the last version only.

The old drafts are not hidden in any clever way. They sit in plain sight, in a part of the file nothing points at. A parser finds nothing there. A text search of the raw bytes finds them instantly.

That gap is the whole problem. You check your work with a parser. Anyone who wants what you took out will use a text search.

What each cleaner did

Measured 6 September 2026, 11:14 PM EDT by scripts/compare-revisions.mjs, against a fixture built by scripts/make-revisions.mjs. Every cell is an observation from the returned bytes, not a reading of a feature list. Tool versions are given because command-line tools change; any row can be rechecked with one command using the published test files.
ToolRevisions in the outputRevisionsSuperseded drafts still in the bytesDrafts left
exiftool -all=13.556 — one more than it started with4 of 4 still presentAppends its own incremental update rather than rewriting, so the four earlier drafts are untouched. It then reports the file as carrying no metadata, because it reads the newest revision — the same reason its removal never reached the older ones.
mat20.15.02 — its own update over a rewritten basenoneRemoves every old draft, by flattening each page into a picture. Nothing survives that, including the text of the document — see the second table. The extra revision is its own, over a base it had already rewritten, so it leaks nothing.
qpdf12.2.01noneRewrites the file from its object graph, so unreferenced revisions are dropped as a side effect. Not a privacy tool and does not claim to be — it preserves the current document properties in full.
Ghostscript10.07.11noneRe-renders the document to a new file, which discards everything unreferenced. Like qpdf, it keeps the current document properties.
Lyonitebuild of 6 September 20261noneReads the file into an object graph and writes a new file from it, so superseded revisions are never carried across. Reports the before and after count on the receipt rather than asserting the behaviour.

The one that removed everything, and what it cost

mat2 is the tool security people recommend, and it did remove every old draft. It is worth knowing how.

It flattens each page into a picture. Nothing survives that, including your document.

The same file through both tools:

One page of text, through both tools. Measured 6 September 2026, 11:14 PM EDT; text counted with pdftotext.
FileSize in bytesBytesSelectable textTextWhat the page reads asReads as
The original2,152330 characters“Lyonite test page 1. The quick brown fox…”
After mat240.5× larger87,2545 charactersnothing — the page is now a picture
After Lyonite0.9× — slightly smaller1,968330 characters“Lyonite test page 1. The quick brown fox…”

The text is gone. Not hidden — gone. It cannot be selected, searched or copied, a screen reader gets nothing from it, and the file is forty times bigger.

For a leaked photograph that is the right trade. For a contract you are about to send a client it is not, and mat2 does not mention it before making the choice for you.

Lyonite removes the same drafts and leaves the document a document. That is the real difference between the two, and it is why this page exists.

What to do about your own files

One rule covers it: a cleaner has to rewrite the file, not edit it. Anything that appends leaves your history intact by design.

And you do not have to trust anyone's description of their own tool. Count the markers.

grep -c "%%EOF" yourfile.pdf — if that says 4, the file has been saved four times and three of those saves are still inside it.

What Lyonite does

It reads the file into a map of every object the document actually uses, then writes a fresh file from that map. Old versions are not on the map — being unreachable is what made them old — so nothing carries them over. The page stays text.

Then it counts. Versions in the file you gave it, versions in the copy it made, both printed on the receipt. If an old draft somehow survived, it says so rather than telling you what it meant to do.

What this test does not tell you

  • It is one fixture. Each of my four old versions holds a name and a title. A real one can hold whole pages, photographs and comments that were deleted later — bigger leaks than these.
  • Rewriting breaks digital signatures. Every tool that passed this test breaks them. Rewriting a file and preserving a signature over its original bytes are the same act pointed in opposite directions. If the signature matters more than the history, do not clean the file.
  • Tools change. Every version I ran is in the table and both scripts are published, so you can rerun this rather than believe it.
  • Lyonite is in the table and I wrote the table. The fixture generator and the checker are in the repository and run against the same file. Check it.

Questions

How do I tell if my PDF has old versions in it?
Count the %%EOF markers: grep -c "%%EOF" file.pdf on macOS or Linux. Three markers means three saves, and two of them are still in the file. The Lyonite metadata viewer reports the same number with the raw marker count beside it, so you can check the arithmetic instead of trusting it.
Does exiftool -all= remove metadata from a PDF?
From the newest version only, and it appends the result as another version — so the file gains one rather than losing one. Measured here: five went in, six came out, all four old drafts intact. ExifTool then reports the file as clean, because it reads the newest version, which is the same reason its removal never reached the older ones. ExifTool is not broken. Writing PDFs this way is correct and it is what keeps signatures valid. It is simply not what you want when you are trying to erase history.
What about -pdf-update:all=?
It undoes ExifTool's own last edit, which is useful and is not cleaning. Run it on a file ExifTool has never touched and it refuses outright: "File contains no previous ExifTool update". It cannot reach the versions Word or Acrobat left in your file.
Should I just use mat2?
For a photograph or a scan, yes — it is thorough, free and well made. For a document, know what it does first: it flattens every page into a picture. On my test file 330 characters of selectable text became 5, and the file went from 2 KB to 87 KB. Afterwards nobody can search or copy the text and a screen reader gets nothing. Lyonite removed the same drafts, kept all 330 characters, and produced a file slightly smaller than the original.
Will removing old versions change how my document looks?
No. The visible document is made entirely of the newest version; the old ones are unreachable objects that nothing on the page refers to. Rewriting drops them and keeps every page, image, font and comment the document actually uses. It does break any digital signature over the original bytes — true of every tool that rewrites, and unavoidable.
Is this a flaw in the PDF format?
No, it is a deliberate feature, and it is the reason a signed PDF stays verifiable after someone adds a comment. The problem is not that PDFs work this way. It is that almost nobody knows they do, and every tool you would check your work with reports on the newest version only.
Corrections

Check this yourself. If I got it wrong, tell me.

Every number here came from files you can download and a checker you can run, so you do not have to take my word for any of it — clone the corpus and get your own result.

If it disagrees with mine, or if you build one of the tools named here and I measured it unfairly, out of date, or with a setting you would not have used, send it to hello@lyonite.com.

I reply within 48 hours. If you are right, the page is corrected with the date on it and your correction credited, and the old number stays visible so the change is legible. If a tool has since been fixed, that is the update I most want to publish. Nothing here is worth defending past the point it stops being true.

Keep reading

Technical references