Accessibility Wiki

Automatic layer state is not allowed

PDF/UA check OCCD_AS_KEY · Structure & other · severity Medium · PDF/UA 8.7 Optional content · advanced check

↩ Back to the rules index · WCAG cross-reference

Advanced check. This is a file-internals rule. It is hidden from the standard report view and generally indicates a problem with the tool that produced the PDF rather than something an author did.

Why it matters

The AS (automatic state) key triggers content visibility changes outside user control, which is incompatible with predictable assistive technology behavior.

What you will see

An optional content configuration uses the AS key, which changes layer visibility outside the user's control.

How to fix

Remove the AS key from every optional content configuration dictionary. Set layer visibility explicitly using the ON and OFF arrays (and BaseState) instead of usage-based automatic states.

Step-by-step guide

  1. Locate every /AS entry in the optional content configuration dictionaries - the default configuration in D and each member of the Configs array under OCProperties (visible via Acrobat Preflight > Browse internal PDF structure).
  2. Before removing anything, record the intent of each usage application dictionary in the AS array (its Event - View, Print, or Export - and the OCGs it controls), so the intended visibility can be reproduced.
  3. Acrobat has no menu or Preflight fixup that edits configuration dictionaries: the AS key was written by the producing application, so either flatten the layers in Acrobat (last step) or regenerate the file from its source with an export pipeline that does not emit usage application dictionaries in the configurations.
  4. Reproduce the intended default visibility explicitly: set BaseState and list the layers in the ON and OFF arrays of the configuration dictionary so visibility no longer depends on automatic usage-based switching.
  5. If the document does not need layers at all, flatten them instead: Layers panel (View > Show/Hide > Side panels > Layers) > options menu > Flatten layers, which removes OCProperties and the AS keys with it.

Verify: Re-run the EQChecker scan and confirm OCCD_AS_KEY passes with zero occurrences.

Note: PDF/UA-2 8.7 flatly prohibits the AS key because it drives automatic state changes from usage information (zoom, print, export) outside user control - unpredictable for assistive technology. Watch print output after removal: layers that were auto-hidden for printing via a Print usage entry now follow their explicit ON/OFF state, so a print-only or screen-only layer may need its state adjusted deliberately.

WCAG success criteria

No WCAG success criterion maps cleanly to this check — it is a PDF/UA structural requirement. The PDF/UA clause above is the normative reference.

Standards

This check contributes to the following standards:

PDF/UA

Standard Criteria
PDF/UA-2 (ISO 14289-2:2024) 8.7 Optional content