Guides/4 min read/Updated

PDF metadata and hidden text: what “redacted” documents still contain

A black rectangle is a drawing, not a deletion. We built a covered-up offer letter and checked what could still be read, copied, and found in the bytes.

PDFs rarely delete anything. Most editing tools cover. A black rectangle drawn in a viewer is a new drawing instruction painted on top of the page, and the text underneath is still in the content stream at the same position. White text on a white page is still text. A “final” version saved as an incremental update still contains the previous version, earlier in the same file. None of this is visible on screen, and all of it can be copied, searched, or read by a script.

A tested example

We built a one-page offer letter the way these files tend to get made in a hurry:

  • The line “Starting salary: $84,000” covered by a black rectangle.
  • An internal note typed in white: “Internal note: candidate asked for 90k, approved up to 88k”.
  • Document properties from the authoring app: Author “mchen”, Creator “Microsoft Word”.
  • The title changed from “offer-letter-draft-v3” to “offer-letter-final” by an incremental save, which is how many editors save by default.

On screen the page looks clean: a black bar and nothing else unusual. Then we checked it three ways:

  • Text extraction with pypdf, which is what copy and paste, search, and screen readers rely on, returned every line, including “$84,000” and the internal note.
  • A byte search of the file found the old title “offer-letter-draft-v3”. The previous version is still there.
  • PDF X-Ray reported 4 critical findings and 1 warning: an earlier version (2 %%EOF markers, 1 previous cross-reference table), white text, covered text, a “runs something when opened” finding, and a warning that identity metadata is still present.

Two of those findings need honest footnotes. The “runs something when opened” item was a false positive: the file had no JavaScript and no open action, only a page transition entry. And the sample text shown under the covered-text finding was the white-text line, not the salary under the box. X-Ray found both real problems, but it attached the samples to the wrong finding. Treat X-Ray results as leads to check on the page, not as an exact map.

Incremental saves

The PDF format allows an editor to append changes to the end of a file instead of rewriting it. Viewers show the newest objects; the older ones stay in the bytes. A file with three %%EOF markers may contain three versions of its text. This is common with signed documents, forms, and files edited over several sessions.

X-Ray counts the markers and earlier cross-reference tables. To get rid of old versions, the file has to be rewritten, not saved again incrementally: a full “Save As” in many editors, printing to PDF, or a tool that builds a new file. Merge PDF and Split PDF copy only the current pages into a new document, which drops earlier versions as a side effect.

Metadata

Document properties (the Info dictionary and the XMP block) can hold an author’s name or username, the authoring application, a title that is really an old filename, creation and modification dates, and sometimes a company name or template path. They are invisible in normal reading and they travel with the file. X-Ray lists them. When we merged files on this site, the output kept only Creator and Producer entries (“UnlimitedPDF”) and the dates; the original titles, authors, and XMP were not copied.

Photos inside PDFs

A phone photo carries EXIF data: camera model, time, and often GPS coordinates. We made a test JPEG with GPS coordinates and a camera model in its EXIF, then converted it with JPG to PDF. The JPEG was embedded byte for byte, EXIF and GPS included. X-Ray flagged it with “Embedded images still carry EXIF / GPS”. The same photo run through Image Resize first came out with no EXIF at all. If location matters, resize or re-save photos before putting them in a PDF.

Other pockets

  • Attachments. A one-page PDF can carry a spreadsheet or another PDF as an embedded file.
  • Form fields. Values can remain in fields that are hidden or positioned off the page.
  • Layers. Optional content can be switched off in the viewer and still be in the file.
  • JavaScript and open actions. Rare in office documents, and worth treating as suspicious if you did not add them.

X-Ray checks each of these and lists what it finds.

What to do instead of a black box

  1. Use a real redaction tool, one that removes the underlying text and image data and writes a new file. The redaction feature in Acrobat Pro does this, as do several open-source tools. A drawing or highlighting tool does not.
  2. Check the result yourself. Select all the text on the page, paste it into a plain text editor, and read it. Anything that pastes is still there.
  3. Run X-Ray on the output and read each finding against the page.
  4. If you only need a visual copy, Compress PDF on High redraws each page as an image. We ran our test letter through it: the output had no extractable text at all, and the old title was no longer in the bytes. It is not a certified redaction workflow and the result cannot be searched, but the hidden text did not survive.

Why the check should run locally

Uploading a document to an online scanner to find out whether it leaks means handing the leak to a third party first. X-Ray runs in the browser tab: the file is read on your device, analyzed there, and the report is generated there. Nothing is sent anywhere.

How we measured

The test files were generated with ReportLab and modified with pikepdf on 27 September 2026, then checked with pypdf, a byte search, and this site’s X-Ray, JPG to PDF, Image Resize, and Compress tools in Chrome on a Linux desktop.

Written by Eli F.. First published 2026-08-28.

Open PDF X-Ray