CreateOptionalContentGroup(String, Boolean) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Creates an optional content group (a layer) named name.

public PdfOptionalContentGroup CreateOptionalContentGroup(string name, bool visible = true)

Parameters

name
String

The name a viewer shows for the group.

visible
Boolean

Whether the group is ON in the default configuration.

Returns

PdfOptionalContentGroup
The group, as OptionalContent lists it.

Remarks

ISO 32000-2 §8.11.2.1, Table 96, and §8.11.4.2, Table 98 (PDF 1.5). The group is a new indirect object listed in OCGs; the catalog gets OCProperties with a default configuration D when it has none. The group is appended to D's Order (when D has one or was created) and to its OFF array when not visible (to ON when visible and D's BaseState is OFF). Apply it with BeginOptionalContent(PdfOptionalContentGroup) or the SetOptionalContent methods of forms, images and annotations. Records PDF 1.5. A mutation.