IsVisible(CosObject?, PdfOptionalContentState) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Returns whether content marked with ocgOrOcmd is visible under state.

public bool IsVisible(CosObject? ocgOrOcmd, PdfOptionalContentState state)

Parameters

ocgOrOcmd
CosObject

The value of an OC entry (XObject, annotation) or the property list of an /OC marked-content section: a group, a membership dictionary, or a reference to one. null and anything else is not optional content: visible.

state
PdfOptionalContentState

States from this properties view.

Returns

Boolean
false only when the content is optional and hidden.

Remarks

ISO 32000-2 §8.11.2, §8.11.3.2 and §8.11.3.3. A group listed in OCGs gives its state, or has no effect when its intent does not count (§8.11.2.3). A membership dictionary evaluates its visibility expression, else its policy over its groups; a malformed expression falls back to the policy (VisibilityExpressionInvalid). A group dictionary not listed in OCGs is not optional content (OptionalContentGroupNotListed). Allocation-free once the membership is compiled.