PDF Layers (Optional Content)
A PDF feature (ISO 32000 Optional Content) that allows page content to be organised into named groups that can be independently shown or hidden — used for language variants, print vs screen versions, CAD drawing layers, and multi-language documents.
PDF Layers — formally called Optional Content Groups (OCGs) in the PDF specification (<a href="https://www.iso.org/standard/63534.html" target="_blank" rel="noopener">ISO 32000</a>) — allow page content to be organised into named groups that can be independently shown or hidden. Viewers with layer support display a Layers panel where users can toggle visibility. Common uses include multi-language documents (one layer per language), print vs screen versions, CAD and architectural drawing layers, and step-by-step instructional content that reveals progressively.
Technical structure of PDF layers
In the PDF specification, Optional Content is managed through several interrelated objects:
<strong>Optional Content Group (OCG)</strong> — A dictionary with a /Name entry that defines a single layer. The OCG has a state (on or off) that controls whether its associated content is visible.
<strong>Optional Content Membership Dictionary (OCMD)</strong> — Groups multiple OCGs with a logical operator (Any, All, None, Not-Any) to define visibility based on the combined state of multiple groups.
<strong>Optional Content Properties Dictionary (/OCProperties)</strong> — A document-level dictionary that lists all OCGs, defines the default On/Off states, and specifies named configurations (sets of OCG states that can be applied at once).
<strong>Usage dictionary</strong> — Each OCG can have a Usage sub-dictionary specifying when the layer should be on or off based on context: print (<code>/Print</code>), screen view (<code>/View</code>), zoom level (<code>/Zoom</code>), export (<code>/Export</code>), or user language (<code>/Language</code>). A layer with a /Print usage set to off will be visible on screen but not printed — a common approach for screen-only watermarks or annotations.
Content is associated with an OCG by wrapping it in a marked content sequence using <code>BDC</code> (Begin Marked Content) with /OC and the OCG reference as the tag. Any content on a PDF page — text, images, paths, annotations — can be made part of a layer.
Common uses of PDF layers
<strong>CAD and architectural drawings</strong> — Engineering drawings exported from <a href="https://www.autodesk.com/products/autocad/" target="_blank" rel="noopener">AutoCAD</a>, <a href="https://www.vectorworks.net/" target="_blank" rel="noopener">Vectorworks</a>, or <a href="https://www.bentley.com/" target="_blank" rel="noopener">MicroStation</a> to PDF typically preserve the original drawing layers as PDF optional content. Contractors can turn specific layers on/off (electrical, plumbing, structural) for review.
<strong>Multi-language documents</strong> — A single PDF with content in English, French, and German on separate layers, each configured with a /Language usage entry. Viewers with language detection can automatically show the appropriate layer.
<strong>Print vs screen variants</strong> — A PDF with a high-resolution version on a print layer and a lower-resolution version on a screen layer. Or navigation elements (clickable buttons, hoverable regions) on a screen-only layer that should not appear in print.
<strong>Step-by-step instructions</strong> — Educational or training PDFs where each step's content is on a separate layer; the viewer can reveal steps progressively.
<strong>Version comparison</strong> — Documents with "proposed" and "current" content on separate layers for markup review.
<strong>Map layers</strong> — Geographic maps with separate layers for roads, points of interest, administrative boundaries, and terrain — allowing users to customise the map view.
Layer support across PDF viewers
Layer support varies across viewers:
<strong>Adobe Acrobat / Adobe Reader</strong> — Full layer support. The Layers panel (View > Show/Hide > Navigation Panes > Layers) displays all OCGs with toggle controls. Usage dictionaries are respected (print vs screen, language, zoom).
<strong>macOS Preview</strong> — Shows all layer content simultaneously (renders all OCGs as on) without a layer panel. Layers cannot be toggled.
<strong>Chrome / Firefox (PDF.js)</strong> — Partial support. <a href="https://mozilla.github.io/pdf.js/" target="_blank" rel="noopener">PDF.js</a> renders layers but the layer panel toggle UI varies by version. Usage dictionaries may not be fully respected.
<strong>Foxit Reader</strong> — Full layer support comparable to Adobe Reader.
For PDFs where layer control is important — CAD drawings, multi-language documents — recipients should use Adobe Reader or Foxit. For PDFs where layers are used for print/screen variants, test in the target viewer to verify the correct layer is active for each context.
<strong>Printing considerations</strong> — Layers with /Print OFF usage entries will not print even if they are visible on screen. This is intentional for screen-only annotations. If a PDF appears to print with missing content, check the Layers panel in Acrobat for layers set to not print.
Layers and accessibility
PDF Layers interact with accessibility in two important ways:
<strong>Reading order</strong> — Screen readers read the PDF content stream in order. If multiple language layers are present and all are rendered simultaneously (because the viewer does not support layers), the screen reader will read all language versions of every text block. This produces a confusing and inaccessible result. For multilingual PDFs that must be accessible, separate PDF files per language is more robust than language layers.
<strong>Flattening layers</strong> — For archiving and accessibility compliance, <a href="https://pdftheguide.com/glossary/flattening" target="_blank" rel="noopener">flattening</a> a PDF merges all visible layers into the base content and removes the optional content structure. This ensures consistent rendering across all viewers and removes the dependency on layer support. For <a href="https://pdftheguide.com/glossary/pdf-a" target="_blank" rel="noopener">PDF/A-1 and PDF/A-2</a> compliance, optional content is technically permitted but all states must be shown simultaneously in the default rendering — a restriction that effectively means layers are rarely used in PDF/A archival documents.
Frequently asked questions
What are PDF Layers?
PDF Layers (called Optional Content Groups in the PDF specification) allow page content to be organised into named groups that can be independently shown or hidden. Viewers with layer support display a Layers panel for toggling visibility. Common uses: CAD drawing layers, multi-language documents, print vs screen variants. Introduced in PDF 1.5 and defined in ISO 32000.
How do I view layers in a PDF?
In Adobe Reader: View > Show/Hide > Navigation Panes > Layers. A panel shows all named layers with checkbox toggles. Foxit Reader has equivalent functionality. Browser-based viewers (Chrome, Edge) have partial layer support; macOS Preview shows all layers simultaneously without a toggle panel.
Why is some content missing when I print a PDF?
Content in a PDF layer with a /Print usage entry set to OFF will not appear in the printed output even if it is visible on screen. This is commonly used for screen-only annotations, navigation elements, and watermarks. In Adobe Reader, open the Layers panel and check whether any layers are configured as print-only or screen-only. You can override layer print settings in the print dialog's Layer Printing options.
Can I remove layers from a PDF?
Yes — flattening the PDF merges all visible layers into the base content and removes the optional content structure. In Adobe Acrobat Pro: File > Save As (choose any PDF format with flattening applied) or use the Print Production > Flattener. For command-line removal, Ghostscript with the pdfwrite device removes optional content and flattens to a single-layer PDF.