THotPDF.AddLoadedOptionalContentGroup Method
Creates a new optional content group (layer) on a loaded document and registers it in /OCProperties /OCGs and the default /D configuration
Declaration
function AddLoadedOptionalContentGroup(const AName: AnsiString; VisibleByDefault: boolean = True): Integer;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
AName | Layer name shown to PDF viewers |
VisibleByDefault | Initial visibility written into the default configuration's /ON or /OFF array |
Return value
Index of the new layer in the OCG array or -1 on failure
Usage notes
- Use the returned index with THotPDF.SetLoadedOptionalContentGroupVisible or THotPDF.AddLayerToOptionalContentOrder
- Use THotPDF.AddLoadedOptionalContentMembership to build a visibility policy across several groups