API referenceImport & Output APIs

pdfImportOCProperties

Recreate the source's optional-content groups (layers) in the

Purpose — Recreate the source's optional-content groups (layers) in the destination.

Description — Walks the source catalog's /OCProperties /OCGs array and creates a destination OCG for each entry, named from the source /Name (fallback Layer N), initially visible. Only the group names are recreated — per-configuration ON/OFF states and order are not imported.

C
BOOL32 __stdcall pdfImportOCProperties(PPDF IPDF);

Return valueTRUE when an import source is open; FALSE otherwise.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Import & Output APIs
Category

Import

Exported names

pdfImportOCProperties

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.