Sanitise a PDF before you share it
A PDF can carry far more than its pages show. It may hold the author’s name, comments, attached files, scripts that run when it opens, layers that are switched off, text outside the page, and earlier versions of the whole file. Sanitising shows you what a file holds, removes the kinds you choose, and gives you a report of every item that went. This page covers the web reader at app.laminapdf.com and the desktop app.
See what the file holds
Section titled “See what the file holds”Open the PDF and choose Sanitise document… from the More menu (the desktop app has it in the File menu), or run it from the command palette. In the web reader, it switches to Edit first, since sanitising changes the file. It then looks through the file. The dialog then lists six kinds of hidden information:
- Document information and metadata: the title, author and dates, the XMP metadata, page thumbnails and data other apps keep in the file.
- Comments and markup: notes, highlights and other comments. Links and form fields stay, and so do redaction marks that were never applied.
- Attachments: embedded files, and the file attachment comments that hold them.
- Scripts and actions: scripts, actions that run on their own, launch other apps, send form data or open web pages, and XFA forms.
- Hidden layers and off-page content: layers that are switched off, content and comments outside the page, and text too faint, too small or too covered to see.
- Earlier versions: the versions of the file saved before this one, and objects nothing uses.
Each row says what it found in plain words and how many items. The button at the end of a row lists the items one by one, each named by its kind, its page and its object number. A file that holds none of them shows Nothing hidden to remove. When a kind couldn’t be checked, the list stays and that row says why, so the dialog never claims a file is clean when it couldn’t look.
Choose what goes
Section titled “Choose what goes”The Preset sets the ticks for you. Before sharing outside the organisation removes everything but the comments, which colleagues often still need. Everything removes the comments too. Tick or untick a row yourself and the preset becomes Custom; the count on the button follows. A row that can’t be read says why, and can’t be ticked. Earlier versions is always ticked, because sanitising rewrites the whole file, and a rewritten file keeps no earlier version.
The button counts what it removes, such as Remove 43 items, and the count follows your ticks. Two cases add a warning. A form built with XFA alone won’t display as before once its scripts go, and the Scripts and actions row says so. A signed file loses its signatures, since the rewrite changes what they cover, and the button then reads Remove signatures and sanitise.
Read the report
Section titled “Read the report”After the removal, the report opens beside the page (on a phone, it opens as a sheet). It starts with how many items went and with the result of a scan that looks through the file again: it should find nothing left in the categories you removed. A section per category lists each item removed. The Kept section lists what stayed: the categories you unticked, and hidden content the reader keeps on purpose, such as the invisible text a scanned page uses for search and copy, and redaction marks that were never applied.
Export report… saves the report as JSON or as text, and Copy as text puts it on the clipboard. The report names items by their kind, page and object number, never by their text, so you can share it without sharing what you removed.
Undo, then save
Section titled “Undo, then save”Sanitising is one step, even when it removes nothing but earlier versions. Undo in the toast that follows, or Undo in the top bar, puts everything back until you save. Saving writes the file as a single new version, without the earlier ones. To check the result, open the saved file and choose Sanitise document… again.
In the web reader, Export… offers the same check before you share: when a file holds attachments or scripts, the Export dialog says so and offers Sanitise… first.