BeginOptionalContent

Content Streams and Optional Content Groups

Description

Begins an optional-content drawing scope on the selected page using an optional-content group or membership dictionary

Use this function when only newly drawn commands should belong to the layer. Use SetContentStreamOptional when an existing selected content stream part should be assigned to an optional content group

Syntax

Delphi

Function TPDFlib.BeginOptionalContent(OptionalContentGroupID: Integer): Integer;

ActiveX

Function PDFlib::BeginOptionalContent(OptionalContentGroupID As Long) As Long

DLL

int DLBeginOptionalContent(int InstanceID, int OptionalContentGroupID);

Parameters

OptionalContentGroupIDAn optional-content group handle or a membership handle returned by NewOptionalContentMembership

Return values

0The optional-content handle was not valid for the selected document or no document was available
1The optional-content drawing scope was opened successfully

Remarks

A membership handle applies its /VE expression when supported and retains /OCGs plus /P as a compatibility fallback