THotPDF.GetLoadedOCGVisibility Method
Queries the default visibility state of a specified optional content group (OCG) in the loaded PDF document
Declaration
function GetLoadedOCGVisibility(Index: Integer): boolean;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Index | Zero-based index of the optional content group |
Return value
若该 OCG 在文档默认配置(D 字典)中标记为可见(ON)则返回 True,否则返回 False
Usage notes
- OCG(Optional Content Group)对应 PDF 中的图层功能,此方法读取的是文档存储的默认状态,而非当前渲染器的状态
- 索引须在文档 OCG 数组的有效范围内,超出范围时返回
False - For documents containing multiple usage configurations (e.g., printing, exporting), the OCG visibility may differ between configurations; this method only reflects the default view configuration