Skip to content

Kernel: optional content — OCG, OCMD and /OCProperties #259

Open

Description

@Tim81

Optional content — layers — is absent from the writer. /OCProperties, /OCGs, /OCMD and /OC
have zero occurrences in src/VellumPdf.Kernel. The validator understands the feature
(OptionalContentRule.cs, UaOptionalContentRule.cs); the writer cannot produce it.

Scope

  • /OCProperties in the catalog, with /OCGs and /D (the default configuration), plus /Configs.
  • Optional content groups (/Type /OCG) with /Name, /Intent and /Usage.
  • Optional content membership dictionaries (/Type /OCMD) with /OCGs, /P and /VE.
  • /OC on form and image XObjects and on annotations.
  • BDC /OC in content streams — which needs a named property list, so this is blocked on B1.

PDF/UA-2 constrains the configuration dictionaries

§8.7 — worth building to from the start rather than retrofitting:

  • When the catalog has a /Configs entry containing at least one configuration dictionary, all
    configuration dictionaries including the default shall contain a /Name whose value is a
    non-empty text string.
  • The /AS key shall not appear in any optional content configuration dictionary.

The second is easy to violate by accident, because /AS is the natural way to express automatic state
changes by usage. Under PDF/UA-2 it is forbidden.

Acceptance

  • A document with two layers, toggled independently, verified in an external viewer.
  • An OCMD with a /VE visibility expression.
  • /OC on an image, a form and an annotation.
  • Every configuration dictionary carries a non-empty /Name; no /AS anywhere — asserted.
  • veraPDF PDF/UA-1 green, and the fixture reusable for ua2 in v2.12.

Relates to

  • B1 — named property lists. Hard blocker for BDC /OC.
  • v2.12 — PDF/UA-2 §8.7 validates exactly these constraints.
  • E11 — AN003 puts optional-content metadata in the OCG dictionary, not the property list.

Plan labels used above, resolved: B1 #249 · E11 #361.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions