PDFium Delphi Component Docs

TextSnapshotCacheCount property

Component: TPdf  ·  Unit: PDFium
Returns how many complete text page snapshots the text snapshot cache currently retains

Syntax

property TextSnapshotCacheCount: Integer; // read only

Description

The value counts the pages whose text snapshot is valid right now, so it is at most Min(TextSnapshotCacheCapacity, PageCount) while a document is loaded

The count grows as TextPageSnapshot completes and caches new snapshots and falls when capacity pressure, page edits, or document reloads invalidate entries

Reading is guarded by the render lock used by native PDFium page access, so the value is consistent with concurrent rendering

Remarks

With no document loaded, or while TextSnapshotCacheCapacity is zero, the count is 0

The count is a point-in-time occupancy figure; use TextSnapshotCacheHitCount and TextSnapshotCacheMissCount for cumulative lookup effectiveness

Example

Snapshot := Pdf.TextPageSnapshot[1];
LogTextSnapshotCache(Pdf.TextSnapshotCacheCount,
  Pdf.TextSnapshotCacheCapacity);

See Also

TextSnapshotCacheCapacity, TextSnapshotCacheHitCount, TextSnapshotCacheMissCount, TextPageSnapshot