Guide

PDF: detect earlier revisions and hidden content

A PDF shows only the current state but can still contain earlier versions and covered content. This matters most for redacted or corrected documents before sharing. ScanBeforeOpen detects hints of this but does not read out earlier states.

Responsible operator: Tom Silas Helmke, operator of ScanBeforeOpen. Content revised: .

Open the matching checker

How incremental updates work

A PDF consists of objects, an xref table with their positions and a trailer. The specification allows changes to be appended: an update adds new objects, a new xref table and a new trailer. The /Prev entry in the new trailer points to the earlier state.

The existing bytes are not overwritten. Viewers follow the newest xref and show the current state. The older content stays in the file until it is written out completely anew. Digital signatures use it as well, since each signature is an incremental save. Several revisions are therefore not automatically a mistake.

How a PDF update leaves earlier content in the file
Revision 1Update, appended/PrevObject 4Amount 100xref, trailer, %%EOFObject 4Amount 120new xref, trailer/Prev points backPDFviewershows 120Readingraw bytesfinds 100Newly written fileonly object 4: amount 120

The sequence in words

  1. A PDF consists of objects, an xref table with their positions and a trailer. In revision 1 the amount is 100.
  2. When saving as an update, a program appends new objects and a new xref. The existing bytes are not overwritten.
  3. Viewers follow the newest xref and show the amount 120. /Prev lets a program trace the chain of earlier states.
  4. The old version is still in the file. Anyone who reads raw bytes or evaluates earlier revisions can find the amount 100.
  5. A full rewrite, for example as page images, contains only the current state. Visible content naturally remains.

Risks when redacting and sharing

A black rectangle over text only covers it. The text can remain underneath and still be selected, copied or searched. A corrected amount or a deleted paragraph can also stay in an earlier revision. Add metadata, comments, embedded files and hidden layers.

Real redaction removes the content from the file and is saved as a new file. Check the result by searching for redacted terms and trying to copy text from the area. A page image export is an additional option but loses text selection, links and accessibility.

Practical checks

Choose the PDF in the scanner and read the recommendation and inspection coverage. A finding about PDF reconstruction hints names which signals were found, such as incremental updates, multiple trailers, document ID or layers. The example file shows the case: the viewer shows the amount 120 while the raw bytes also contain the amount 100.

Before sharing, export the file anew instead of just saving it, search for redacted terms, remove metadata and open the finished file once more. For short PDFs, ScanBeforeOpen offers a page image copy as ZIP that contains only the visible state.

Limits of detection

The scanner searches the raw bytes for keywords such as startxref and trailer. It neither builds the object graph nor reads out earlier revisions, nor does it confirm whether content was really removed. Several startxref entries also occur in linearized PDFs and therefore do not prove an update.

Compressed object streams, encryption and unusual structures can hide signals. The result therefore remains a limited raw data check even without a finding.

Reproducible synthetic example

The PDF shows the amount 120 but still contains the earlier version with the amount 100 as an appended revision. rebuild.pdf reports incremental updates and multiple trailers. The scanner does not read out the earlier content.

The findings come from an actual local scan of this test file. Download it and choose it in the scanner. No real personal data or malware.

Download test file: revisions-demo.pdf

Example inspection coverage: partial.

Practical checklist

  • Redact only with a function that removes content, not with rectangles
  • Save the result as a new file
  • Search for redacted terms and try to copy text from the area
  • Check metadata, comments and embedded files
  • Scan the file and read the inspection coverage
  • Open the version you share yourself at the end

Clear limits

The PDF check is a raw data search with limited meaning. Earlier revisions are hinted at, not read out, and redactions are not verified. Neither green nor a page image export is a clearance for confidential documents.

FAQ

Does ScanBeforeOpen show the earlier content of a PDF?

No. The scanner detects hints of several revisions but does not read out earlier states and does not confirm that anything was removed.

Do several startxref entries always mean an update?

No. Linearized PDFs also have several xref sections. The hint is a reason to check, not proof.

Does the page image export remove all earlier content?

It contains only the visible state of the drawn pages. Visible confidential details remain, and text, links and accessibility are lost.

Related reading

Technical sources