PDF Optional Content (OCG)

The technical name for the architecture that powers PDF layers. It allows specific parts of the PDF code to be tagged and then "switched" on or off based on user interaction or pre-defined circumstances.

What is Optional Content?

While most users call them "Layers," the official PDF specification refers to them as **Optional Content Groups (OCGs)**. An OCG is essentially a "tag" that you apply to specific pieces of PDF code. For example, you can take all the lines and text that make up the "Level 2 Floor Plan" and tell the PDF: "This content belongs to OCG #1."

A document can then have an **Optional Content Configuration Dictionary (OCCD)**. This is a master control panel that defines how those OCGs behave. It tells the PDF reader things like: "Start with OCG #1 hidden" or "Only show OCG #2 if the user chooses 'Spanish' in the settings."

How it Differs from Standard Hiding