Layer (PDF)
An optional content group in a PDF — text, images, or annotations organized into independent layers that can be shown, hidden, or printed separately.
PDF layers (technically called Optional Content Groups or OCGs in the spec) let a single PDF carry multiple independent content groups that can be toggled on and off. Think of them like layers in Photoshop — the pixels all exist in the file, but the reader chooses which to display.
Common uses
- Engineering drawings — architectural plans where electrical, plumbing, and structural details can each be toggled independently
- Multilingual documents — the same page with English, Spanish, and French text layers; switch visibility to change language
- Review comments vs clean text — one layer holds the annotation comments, another holds the original text
- Print vs screen — watermarks or confidentiality stamps that only show on screen, or only on print
Layers vs annotations
Layers are different from annotations:
- Annotations sit on top of content and are typically visible/hidden as a group
- Layers partition the *content itself* — text strings, vector shapes, images — into independent groups
Layers and security
Layers are not a security mechanism. Content on a hidden layer is still present in the file and can be extracted with a PDF analysis tool. For truly removing content, use redaction or flattening — not hiding via layers.