DeleteOptionalContentGroupEx

Content Streams and Optional Content Groups

Description

Deletes an optional content group and decides what happens to the content it controls

Syntax

Delphi

Function TPDFlib.DeleteOptionalContentGroupEx(OptionalContentGroupID, Options: Integer): Integer;

Parameters

OptionalContentGroupIDAn ID returned by the NewOptionalContentGroup, GetOptionalContentGroupID or GetOptionalContentConfigOrderItemID functions
Options0 = only unregister the group, as DeleteOptionalContentGroup does; 1 = also remove the content the group controls; 2 = keep that content as ordinary, always visible page content

Return values

0The group ID is invalid, Options is out of range, or the group could not be removed
1The group was deleted

Remarks

Viewers show content whose group is no longer registered, so deleting a layer that was hidden by default with option 0 makes its content visible to everyone. Option 1 removes the marked content (BDC /OC … EMC) on every page, the Form and image XObjects bound to the group and the annotations bound to it. Option 2 removes only the markers and the bindings, so the content is drawn as part of the page

With Options 1 or 2, marked content (BDC /OC … EMC) inside Form XObjects (including nested Form XObjects) is recursively rewritten, and optional content membership dictionaries (/OCMD) that reference the deleted group are updated or removed when no other member groups remain

See also

DeleteOptionalContentGroup, GetOptionalContentGroupID