SetOptionalContentConfigInfo
Optional content
Description
Writes presentation metadata onto the default optional-content configuration
Syntax
Delphi
Function SetOptionalContentConfigInfo(Const ConfigName, Creator, ListMode: WideString): Integer;Parameters
| ConfigName | Name written to the default optional-content configuration |
|---|---|
| Creator | Creator entry written to the default optional-content configuration |
| ListMode | Layers-panel list mode: an empty string omits the entry, or AllPages or VisiblePages |
Return values
| 0 | No document is loaded, the document carries no optional-content groups, or ListMode is neither empty, AllPages nor VisiblePages |
|---|---|
| 1 | The metadata was written to the default configuration |
Remarks
Writes presentation metadata onto the /OCProperties /D dictionary: ConfigName becomes /Name (the configuration name shown by viewers), Creator becomes /Creator (the application that authored the configuration), and ListMode becomes /ListMode controlling whether the layers panel lists groups from all pages (AllPages) or only the visible pages (VisiblePages). Leave a parameter empty to skip it. The document must already define at least one optional-content group, because a document without /OCProperties has no default configuration to describe. Panel ordering, radio bundles and lock state remain available through the existing AddOptionalContentConfigOrderGroup, AddOptionalContentConfigRadioGroup and SetOptionalContentConfigLocked APIs.
Example
PDF.SetOptionalContentConfigInfo("Print layers", "losLab", "VisiblePages");