PDFium Delphi Component Docs

TextSnapshotCacheHitCount property

Component: TPdf  ·  Unit: PDFium
Counts the text snapshot reads that were served from a retained page snapshot

Syntax

property TextSnapshotCacheHitCount: Int64; // read only

Description

The counter increments once for every TextPageSnapshot access whose page already holds a valid snapshot. The hit refreshes the page slot in least-recently-use order, touches the entry in the shared cache governor, and returns a deep copy of the retained snapshot

Consumers such as GetStructuredText and the physical-layout GetTextInReadingOrder reuse the same snapshot, so their repeated reads also appear here as hits

The value is cumulative for the lifetime of the TPdf instance and never resets

Remarks

Reading is guarded by the render lock used by native PDFium page access

Capacity changes, page edits, document reloads and clears preserve the counter; they change what is retained, not what has already happened

Because every return value is a deep copy, a hit never exposes cached strings or arrays to mutation by the caller

Example

Structured := Pdf.GetStructuredText(1, Options);
Structured := Pdf.GetStructuredText(1, Options);
// The second read is served by one cached snapshot
// The second read is served by one cached snapshot

See Also

TextSnapshotCacheMissCount, TextSnapshotCacheCount, TextSnapshotCacheCapacity, TextPageSnapshot, GetStructuredText