Hidden Data in PDFs: Scripts, Attachments, Bad Redactions
Go through your contract, résumé or invoice layer by layer and clean the real file in your browser before you attach it to an email.
A PDF can carry far more than the pages you see: the name of whoever made it, scripts that run when it opens, embedded attachments, form fields anyone can rewrite, and the full-resolution originals of every image. Before you send it, you can sanitize the PDF and strip its active content using your own file. It runs in your browser with no upload, no cost and no signup, and it shows a before-and-after report of exactly what it removed.
This guide walks through each layer, the tool that handles it and where that tool stops, so cleaning a file doesn't give you a false sense of security.
What can a PDF carry that you can't see?
Hidden PDF data falls into four groups: metadata, active content, editable elements and original images. Almost none of it is malicious. It's leftover from how the file was made, and it deserves the same scrutiny as the visible text.
Metadata: author, software and dates
Every PDF stores a title, author, software and dates, and can carry a copy in XMP. The fields are described one by one in which PDF metadata fields exist and who can read them. With PDF metadata you choose what to change or delete in the Info dictionary, and Sanitize PDF removes them together with the active content.
Active content: JavaScript, actions and attachments
The PDF format supports JavaScript, actions that fire when the document opens, actions that launch other programs, file attachments, 3D content with its own scripts, and external links. An ordinary document rarely needs any of them, yet old templates and forms carry them along, and a forgotten attachment (say, a spreadsheet tucked inside the PDF) is more common than you'd expect.
Sanitize PDF removes JavaScript, auto-open and launch actions, attachments and metadata, and can also drop external links if you switch that option on. When it finishes, it shows a before-and-after report from the same engine as the PDF scanner, so you can see exactly what disappeared.
Here's the honest limit: sanitizing removes active content but doesn't rewrite fonts or images, so it doesn't guarantee protection against an exploit hidden in a font or a malformed image. If someone sent you the PDF, the scanner lists the markers it contains without running anything; it isn't an antivirus either. More background in whether a PDF can contain a virus.
Editable fields, comments and higher-resolution images
Two more leaks aren't about security but about control: what the recipient can change, and what they can recover from your images. Both are easy to fix before sending.
Form fields and comments someone can change
If your PDF has filled-in fields or comments, whoever receives it can edit them. Flatten PDF turns them into a fixed part of the page, in two modes. In "Forms" mode, each field's value is drawn onto the page and the field is removed; the text stays vector, selectable and sharp. That mode only handles form fields, not comments or highlights. In "All" mode, every page is rasterized with forms and annotations included: nothing remains editable, but the text is no longer selectable.
Embedded images that hold more than they show
A photo shrunk on the page may be stored in the PDF at its original resolution, sometimes with more detail than you meant to share. Extract images from a PDF works as an audit: you download everything in a ZIP, JPEGs come out byte-identical to what's inside the PDF, and the rest are converted to PNG. If something shouldn't go out, rebuild the document without that image before you send it.
Do black boxes really remove the text underneath?
No: a black rectangle drawn on top only covers the text, which stays in the file where it can be selected, copied or searched. The mistake has tripped up high-profile court filings: in January 2019, a filing by Paul Manafort's lawyers had blacked-out passages that could be copied and pasted into another document, according to the Atlanta Journal-Constitution. A real redaction deletes the content underneath.
To actually remove it, use Redact PDF, which deletes the text under each box in your browser and checks the final file before it lets you download it. The step-by-step and the full case are in why a black box doesn't redact a PDF.
What if the PDF is corrupted?
If a PDF won't open or looks incomplete, try Repair PDF before recreating it: it rebuilds the file's internal structure and tells you which method worked, how many pages it recovered out of how many there were, and what was lost. As a last resort it redraws pages as images, and those pages lose selectable text. It recovers what can be recovered; it can't perform miracles on a truncated file. If you need both, repair first and sanitize afterwards.
A quick checklist before you send a PDF
- Open the PDF and search with Ctrl+F or Cmd+F for anything you thought was covered.
- If it has forms or comments, flatten it: "Forms" or "All", depending on what you need.
- If you will export it from Word, run the Document Inspector first: it finds comments, document properties and personal information.
- Run it through the sanitizer and compare the before-and-after report.
- If it contains photos, extract the images and check what they hold.
- Check the metadata last, after any other change, because some tools update dates or software when they save a PDF.
- If the file came from someone else, scan it before opening it.
All of this runs in your browser, with no upload, no cost and no signup, which is the point of cleaning a contract or résumé on your own machine instead of on someone else's server.
Related guide: Task-by-task guide: what you can do with a PDF without uploading it.
Frequently asked questions
Can a PDF contain information I can't see on screen?
Yes. Beyond the pages themselves, a PDF stores metadata (author, software, dates), may include attachments and scripts, can keep form fields and comments editable, and often holds the original images at a higher resolution than the page displays. None of it shows up when you read the document, but all of it travels with the file when you send it.
What's the difference between the metadata tool and the sanitizer?
The metadata tool lets you read each field (title, author, software, dates) and choose what to change or delete. The sanitizer works on active content: it strips JavaScript, auto-open and launch actions, attachments and metadata in one pass, then shows a before-and-after report. Use the first to inspect one field, the second for a full clean.
Does sanitizing a PDF guarantee it's safe to open?
No. Sanitizing removes the format features that run or launch things, but it doesn't rewrite fonts or images, so it can't protect you from an exploit hidden in a font file or a malformed image. Keep your PDF reader updated and scan files you didn't create. The scanner reports what a file contains, but it isn't an antivirus.
Should I flatten in Forms mode or All mode?
Forms mode keeps the text as vector text (still selectable and searchable) but only locks form fields, not comments or highlights. All mode rasterizes every page, so no field or annotation stays editable, but the text is no longer selectable. Pick Forms if you just need filled-in values fixed in place, and All if nothing should be changeable.
Is drawing a black box over text enough to hide it?
No. The box is just a shape on top: the text is still in the file and can be selected, copied or searched. A true redaction deletes the content underneath. Docuboxer's Redact PDF does it in your browser and checks the final file before it lets you download it. Still, press Ctrl+F or Cmd+F to confirm that what you covered doesn't show up in search.
Is it safe to clean a private PDF with these tools?
Processing happens in your browser and the file isn't uploaded to any server. You can confirm it by opening the Network tab in your browser's developer tools while you use a tool. They're free and don't require an account.
Sanitize your PDF before you send it
Remove JavaScript, attachments and metadata, then compare before and after. 100% local, free, no signup.
Open Sanitize PDF →Related tools
- Redact PDF: removes the text under each box and verifies the result.
- Sanitize PDF: Strips active content, attachments and metadata, with a report.
- PDF metadata: Read, edit or delete author, software and dates.
- Flatten PDF: Lock forms and annotations so nobody can change them.
- Extract images from PDF: Download the original images as a ZIP.
- Repair PDF: Recover damaged files and learn what was lost.
- PDF scanner: Inspect a PDF you received without running it.
You might also like: which metadata fields a PDF stores and can a PDF contain a virus?
Sources
- Atlanta Journal-Constitution, Manafort's lawyers and the blacked-out passages (January 8, 2019) (accessed October 13, 2026).
- Microsoft, remove hidden data and personal information by inspecting documents (accessed October 13, 2026).