PDF OCG Layers Viewer
View and toggle Optional Content Groups (layers) in PDF files online for free. All processing in your browser — no files uploaded.
How to Use
View and control PDF layer visibility in four steps:
- Upload your PDF — Drag and drop a PDF file or click the dropzone to browse. The tool reads the file locally in your browser and immediately scans the document catalog for
/OCProperties, the dictionary that defines Optional Content Groups. - Review discovered layers — The left panel lists every OCG layer found in the document, showing each layer's name and current visibility state. A checkbox next to each layer indicates whether it is ON (visible) or OFF (hidden) according to the PDF's default configuration.
- Toggle layer visibility — Click individual checkboxes to show or hide specific layers, or use the Show All / Hide All buttons for bulk operations. Navigate between pages using the Previous and Next buttons to inspect how layer changes affect different parts of the document.
- Save and download — Click Save with Current Visibility to generate a new PDF with your layer configuration baked into the default viewing configuration. The tool updates the
/Ddictionary's/ONand/OFFarrays, then click Download to save the modified file.
The entire operation runs in your browser using pdf-lib for PDF manipulation and pdfjs-dist for rendering. Your PDF is never uploaded to any server.
About This Tool
Optional Content Groups (OCGs) are a PDF feature introduced in PDF 1.5 (Adobe Acrobat 6, 2003) that enables multi-layered documents where individual content layers can be independently toggled on or off. The OCG mechanism is defined in Section 8.11 of the PDF specification (ISO 32000-2:2020) and is widely used in architectural drawings, engineering blueprints, cartographic maps, and complex graphic design files.
At the structural level, OCG layers are defined in the document catalog's /OCProperties dictionary, which contains two key entries. The /OCGs array lists every OCG dictionary in the document — each one representing a single named layer with a /Type of /OCG and a /Name entry for the display label. The /D entry provides the default viewing configuration, which controls initial layer visibility through /ON and /OFF arrays of OCG references.
The default configuration dictionary (/D) supports several configuration options. The /BaseState entry determines the baseline visibility of all layers — when set to /ON (the default), all layers are visible unless explicitly listed in the /OFF array. When /BaseState is /OFF, all layers are hidden except those in the /ON array. This tool reads both states correctly and normalizes the visibility model for a consistent editing experience.
Content within a PDF page stream is associated with OCG layers through Optional Content Membership Dictionaries (OCMDs) or direct /OC references on XObject forms and marked content sequences. When a PDF viewer renders a page, it checks each content element's OCG association against the current visibility state. Elements linked to a hidden OCG are simply not drawn — the content remains in the file but is suppressed at render time. This is fundamentally different from deleting content: toggling a layer back on immediately restores all associated content to full fidelity.
In CAD and architecture workflows, OCG layers commonly separate structural systems: one layer for walls and foundations, another for electrical wiring, a third for plumbing, and additional layers for HVAC, landscaping, and annotations. An architect can share a single PDF with all systems present, and each trade discipline toggles on only the layers relevant to their work. AutoCAD, SolidWorks, Revit, and similar software natively export layered PDFs that map their internal layer systems to OCGs, preserving the full layer hierarchy in the distributed document.
Graphic design applications like Adobe Illustrator and InDesign also leverage OCG layers for versioning and localization. A multilingual brochure might store English, French, and German text on separate layers, with the default configuration showing only the primary language. Toggling layers lets reviewers switch between language versions without opening multiple files. Map publishers use layers to separate road networks, terrain, political boundaries, and labels — enabling users to customize which information is displayed.
When this tool saves layer changes, it modifies only the /D default configuration dictionary within /OCProperties. Page content streams, fonts, images, and all other document elements remain completely untouched. The modified PDF will open in any compliant viewer with your chosen layer visibility as the default state, while users retain the ability to toggle layers manually in viewers that support OCG controls (Adobe Acrobat, Foxit Reader, PDF-XChange).
Why Use This Tool
Inspecting and controlling PDF layer visibility serves several critical purposes across engineering, design, and document management workflows:
- Pre-print quality control — Before sending layered PDFs to commercial printers, you need to verify that the correct layers are visible. A construction document sent with the electrical layer hidden would produce incomplete blueprints. This tool lets you visually confirm layer states without installing desktop PDF editors like Adobe Acrobat Pro ($22.99/month).
- Cross-discipline document review — Engineering teams share multi-system drawings as single layered PDFs. A mechanical engineer reviewing ductwork needs to see HVAC layers while hiding electrical and plumbing detail. Toggling layers isolates relevant content without creating separate files for each discipline.
- Selective information sharing — When distributing PDFs externally, you may need to hide proprietary layers — internal annotations, draft markings, or confidential dimensions — before sending the file. Saving with modified visibility sets the default view so recipients see only the intended content.
- Localization and versioning — Multilingual documents stored as layered PDFs can be configured to show a specific language by default. Publishing teams use this to create region-specific versions from a single master file, avoiding the overhead of maintaining separate documents per language.
- Troubleshooting rendering issues — When a layered PDF displays incorrectly in a viewer, isolating layers one at a time helps identify which layer contains problematic content — corrupt image references, invalid fonts, or malformed content streams.
- Archival simplification — For long-term storage, setting the default visibility ensures future viewers display the document as intended, even if the user does not know how to access layer controls in their PDF reader application.
Processing layered PDFs locally is especially important in architecture and engineering contexts. Construction drawings, facility plans, and manufacturing schematics often contain proprietary intellectual property and sensitive building security information. This tool processes your document entirely in the browser — no server uploads, no cloud processing, no third-party access — ensuring confidential plans remain on your device throughout the editing process.