THPDFHeadlessOptionalContentState

Declared in HPDFHeadlessOptionalContentState; this caller-owned object explicitly enables viewer-style optional-content usage application when borrowed through THPDFHeadlessRenderOptions.ViewerState

Each render initialises D, applies View applications, then persistent manual selections; Print and Export apply temporarily over that state, leaving the object and PDF metadata unchanged

Keep the state alive and unchanged throughout rendering; do not call setters, clear selections or free it concurrently with a render

Read-only states do not share renderer caches between calls, but the borrowed document callbacks retain their serial-use contract; concurrent rendering requires an adapter that serializes those callbacks

Reloading, modifying, closing or destroying the owning document permanently expires the state, including copies of its original access record; obtain fresh access and create a fresh state before rendering again

Methods: Create, Validate, SetGroupState, ClearGroupState, RevertManualSelections, Selection

Properties: Context, Event, SelectionCount

See the viewer-state guide for usage categories, explicit context, budgets and examples