PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
optional_content.h File Reference

Optional Content API. More...

#include <pdfsdk/core/api_macro.h>
#include <pdfsdk/core/atoms.h>
#include <pdfsdk/errors.h>
#include <pdfsdk/math_types.h>

Go to the source code of this file.

Typedefs

typedef struct PDOCGRec_ * PDOCG
 Represents an optional content group (OCG) in a PDF document.
 
typedef struct PDOCMDRec_ * PDOCMD
 Represents an optional content membership dictionary.
 
typedef struct PDOCConfigRec_ * PDOCConfig
 
typedef void(PDFSDK_CALLCONV * PDOCConfigChangedProc) (void *clientData)
 

Enumerations

enum  PDOCGStateOperation { kPDOCGStateOperationOff , kPDOCGStateOperationOn , kPDOCGStateOperationToggle }
 Specifies whether the targeted Optional Content Group (OCG) should be visible or hidden when the action (operation) is executed. More...
 

Functions

PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocAttachOCConfigChangedCallback (PDDoc doc, PDOCConfigChangedProc proc, void *clientData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocDetachOCConfigChangedCallback (PDDoc doc, PDOCConfigChangedProc proc, void *clientData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocNotifyOCConfigChanged (PDDoc doc)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocSetOCConfig (PDDoc doc, PDOCConfig config)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetOCConfig (PDDoc doc, PDOCConfig *pConfig)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocCreateOCG (PDDoc doc, const wchar_t *name, size_t nameSize, PDOCG *pOCG)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetNumOCGs (PDDoc doc, size_t *pNumOCGs)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetOCG (PDDoc doc, size_t index, PDOCG *pOCG)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCGFromPDObject (PDObject object, PDOCG *pOCG)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCGGetPDObject (PDOCG ocg, PDObject *pObject)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCGSetName (PDOCG ocg, const wchar_t *name, size_t nameSize)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCGGetName (PDOCG ocg, wchar_t *buffer, size_t bufSize, size_t *pSize)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCMDFromPDObject (PDObject object, PDOCMD *pOCMD)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCMDGetPDObject (PDOCMD ocmd, PDObject *pObject)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCMDCreateFromOCG (PDOCG ocg, PDOCMD *pOCMD)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCMDIsVisible (PDOCMD ocmd, PDOCConfig config, bool *pVisible)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCConfigFromPDObject (PDObject object, PDOCConfig *pOCG)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCConfigGetPDObject (PDOCConfig ocg, PDObject *pObject)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCConfigGetOrder (PDOCConfig config, PDObject *pOrder)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCConfigSetOCGState (PDOCConfig config, PDOCG ocg, bool state, bool preserveRB)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCConfigGetOCGState (PDOCConfig config, PDOCG ocg, bool *pState)
 

Detailed Description

Optional Content API.

Typedef Documentation

◆ PDOCConfig

typedef struct PDOCConfigRec_* PDOCConfig

A PDOCConfig represents a set of states and other information from a OCProperties dictionary.

There is a document default configuration, saved in the /D entry in the OCProperties dictionary, and a list of other client configurations, saved as an array of configurations in the /Configs entry in the OCProperties dictionary.

Layers are generally displayed as Optional Content Groups.

See 8.11.4 Configuring Optional Content in PDF32000_2008.pdf

See also
PDOCConfigGetOrder
PDOCConfigSetOCGState
PDOCConfigGetOCGState

◆ PDOCG

typedef struct PDOCGRec_* PDOCG

Represents an optional content group (OCG) in a PDF document.

An optional content group (OCG) is a collection of content that can be displayed or hidden in a PDF document.

For more information refer to section 8.11.2 Optional content groups,

◆ PDOCMD

typedef struct PDOCMDRec_* PDOCMD

Represents an optional content membership dictionary.

An optional content membership dictionary (OCMD) is a dictionary that specifies the optional content groups (OCGs) that are to be displayed or hidden in a PDF document. It is used to control the visibility of layers in the document.

For more information refer to section 8.11.2.2 Optional content membership dictionaries

Enumeration Type Documentation

◆ PDOCGStateOperation

Specifies whether the targeted Optional Content Group (OCG) should be visible or hidden when the action (operation) is executed.

For more information refer to section 12.6.4.13 Set-OCG-state actions, key State, from the from the ISO 32000-2:2020 (PDF 2.0) Standard.

Enumerator
kPDOCGStateOperationOff 

Hides the specified OCGs.

kPDOCGStateOperationOn 

Makes the specified OCGs visible.

kPDOCGStateOperationToggle 

Reverses the state of the specified OCGs.

Function Documentation

◆ PDOCConfigGetOrder()

PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDOCConfigGetOrder ( PDOCConfig config,
PDObject * pOrder )

Gets the user interface display order of optional-content groups (OCGs) in an optional-content configuration.

Parameters
configThe configuration for which an OCG display order is desired.
[out]pOrderA pointer to the PDOCOrderNode object containing the OCG order array.