BASALT · JOURNAL

Hidden layers, and content that is present but not drawn

2026-08-09 · pdf hidden layers optional content

A PDF can contain optional content groups, usually called layers. A layer that is switched off is not drawn on the page and remains fully present in the file.

This is a legitimate feature. Drawings with alternative dimensions, documents with multiple language overlays, and CAD exports all use it properly.

It becomes a problem when a layer contains something that was hidden rather than something that is optional.

How material ends up in a hidden layer

Occasionally deliberately. More often as a by product: a template with a draft watermark layer, an export from software that placed annotations on their own layer, or an earlier version of a page preserved as an alternative.

The person sending the document sees the page as it renders, which is the version with the layer off, and has no particular reason to suspect anything else exists.

Warning versus removing

Many tools will tell you a document contains optional content. That is useful and it is not sufficient, because a warning transfers responsibility to a reader who may not know what to do about it.

Removing the content, not merely leaving the layer switched off, is the action that makes the document safe. Switching a layer off changes a flag; the content stays.

Basalt removes hidden optional content entirely as part of sanitisation rather than reporting it. The distinction matters because the failure mode of a warning is a document that shipped anyway.

Checking a document

Expand the structure and look for optional content markers:

qpdf --qdf --object-streams=disable in.pdf out.pdf
grep -a "/OCG\|/OCProperties" out.pdf

Presence does not mean a problem, since the feature has legitimate uses. It means there is content in the file that the page you looked at did not show you, and on a document being produced that is worth resolving rather than assuming.

The general principle

Every leak of this kind shares a structure: the file contains more than the page displays. Metadata, attachments, earlier revisions, form values, OCR text and hidden layers are all instances of it.

Checking the page tells you about the page. Checking the file tells you about the file, and only the second one is the question.

Frequently asked questions

What are optional content groups in a PDF?

Layers that can be shown or hidden. They have legitimate uses in drawings, multilingual documents and CAD exports, but a layer switched off is not drawn while remaining entirely present in the file.

Does hiding a layer remove its content?

No. Hiding changes a visibility flag and the content stays in the file, fully recoverable by switching the layer back on or by extracting it directly.

Is warning about hidden layers enough?

No. A warning transfers responsibility to a reader who may not act on it, and the failure mode is a document that ships anyway. Removing the content is what makes the file safe.

How do I check a PDF for hidden layers?

Expand the file structure with qpdf --qdf --object-streams=disable and search the output for /OCG or /OCProperties. Their presence is not automatically a problem, but it means the file contains content the page did not show you.

Doing it in Basalt

Basalt is a native macOS PDF toolkit with eighteen tools in one window: merge, split, compress, OCR, Bates numbering, privilege logs, forms, signing, watermarks, comparison and more. Redaction destroys content rather than covering it, and an independent verifier re-opens every written file and proves the material is gone before the file is saved. If it cannot prove it, nothing is written. A one time $29 licence covers up to three Macs, it is free for the first 24 hours, there is no account, and the engine holds no network entitlement at all, which macOS enforces at the code-signature level. Download it at basaltformac.com.

Redaction that proves itself

Basalt destroys the content you mark, then re-opens the file it wrote and proves the content is gone before it saves anything. Your documents never leave your Mac.

DOWNLOAD BASALT 2.3.0 BUY $29 FREE FOR 24 HOURS · MACOS 13+