PDF layers — formally called Optional Content Groups (OCGs) — give authors the ability to show or hide sections of a PDF without altering its content. Think of layers as transparent acetate overlays: each layer can be toggled independently, and combinations of visible layers produce different views of the same document. Layers are used extensively in architectural and engineering drawings (show electrical, plumbing, and structural plans independently), in print production (separate Pantone spot colour plates), in multi-language documents (show only the relevant language layer), and in interactive presentations (reveal content progressively). The feature is powerful but has important constraints in archiving and accessibility contexts.

The OCG data model

The PDF optional content model has three main objects: Optional Content Group (OCG) — The fundamental unit: a named dictionary object with a /Name string. Each OCG has a state: on or off. Page content is associated with an OCG via marked content sequences tagged with /OC operators referencing the OCG. When an OCG is off, its associated content is not rendered. Optional Content Group Membership Dictionary (OCMD) — A more advanced object that expresses boolean combinations of OCG states: content is visible if (OCG-A is on AND OCG-B is off), for example. OCMDs enable complex conditional visibility logic. Optional Content Properties Dictionary (/OCProperties) — Stored in the document catalogue, this is the master registry of all OCGs in the document, plus default states and display intent information. It defines which OCGs are in the "Default" intent (normal viewing), "View" intent, and "Print" intent — allowing different layer states for screen viewing vs. printing. Layer groups and nesting — The /OCProperties dictionary contains an /D (default configuration) entry that specifies display order, nesting/grouping of OCGs (for UI presentation in the Layers panel), and initial ON/OFF states. This is purely for UI organisation — the technical visibility mechanism is per-OCG state, not hierarchical.

Creating layers in Acrobat and InDesign

Adobe InDesign is the primary tool for creating layered PDFs in professional publishing workflows. InDesign's layer system maps directly to PDF OCGs on export. To create a layered PDF from InDesign: 1. Set up your content on separate InDesign layers (Window > Layers). 2. Export to PDF (File > Export > Adobe PDF). 3. In the General tab of the PDF export dialog, check "Create Acrobat Layers." 4. All InDesign layers become OCGs in the exported PDF, with the same names and initial visibility states. Adobe Acrobat Pro can add layers to existing PDFs via the Layers panel (View > Show/Hide > Navigation Panes > Layers). However, creating new layer content in Acrobat is limited — you can import layered PDF content from other documents or use Actions to automate layer management. AutoCAD and CAD tools produce PDF exports with layers automatically from DWG layer structure. Bluebeam Revu is widely used for working with layered engineering PDFs. PDF libraries — iText 7 (itextpdf.com), pdfium, and pdf-lib all have OCG APIs. For creating programmatic layered PDFs, iText's PdfLayer class is the most complete implementation.

PDF/A, PDF/UA, and layer constraints

Layers interact with both archiving and accessibility standards in important ways. PDF/A-1 prohibits layers entirely — PDF/A-1 (ISO 19005-1) does not permit optional content groups. Documents with layers cannot conform to PDF/A-1. PDF/A-2 permits layers with constraints — PDF/A-2 and PDF/A-3 allow OCGs, but with a critical requirement: the document must be fully renderable with all OCGs in their default state. You cannot archive a PDF/A-2 document that is meaningless or blank when all layers are at their default visibility. The intent is that the archival record is the default-state document, and layer toggling is an optional interactive feature. PDF/UA and accessibility implications — PDF/UA requires that all content in the structure tree is accessible. Hidden layer content presents a question: should content in a hidden layer be in the structure tree? The PDF/UA specification and the Matterhorn Protocol indicate that hidden layer content should not interfere with the logical reading order. Practically, this means layer content must be carefully managed in the tagged structure — hidden content should be artifact-marked or excluded from the reading order. Print vs. view intents — A common use case is a document that shows watermarks on screen but not when printing, or that shows crop marks when printing but not on screen. This is implemented using the /Print and /View usage entries in an OCG's usage dictionary, combined with the /OCProperties/D/AS (auto-state) entries that set the OCG state based on rendering context.

Multi-language PDFs with layers

One of the most powerful uses of PDF layers outside of technical drawing is multi-language document production. The principle: create a single PDF with all language versions, each on its own OCG. The reader (or viewer configuration) shows only the relevant language layer. Advantages over separate files: Single file distribution, consistent layout across languages, easier translation tracking. Implementation approach: 1. Design the layout in InDesign with text frames on language-specific layers (one layer per language). 2. Include any language-independent content (images, graphics, common text) on a shared "Base" layer. 3. Export with "Create Acrobat Layers" — InDesign creates one OCG per layer. 4. In Acrobat, the Layers panel displays the language layers. Default visibility can be set per target audience. Automatic language switching — Using Acrobat JavaScript, an OpenAction script can detect the viewer's locale and set layer visibility accordingly on document open. However, JavaScript is disabled in many security contexts and browser viewers — this approach should be treated as an enhancement, not a requirement. Accessibility considerations — A multi-language layered PDF with a screen reader is problematic unless only one language layer is visible at a time: the screen reader will read content from all visible layers, mixing languages. For accessibility-critical documents, separate files per language remain the most reliable approach.