PDFium Delphi Component Docs

ThumbnailCacheMaxEntries property

Component: TPdf  ·  Unit: PDFium
Sets how many previews the revision-aware thumbnail cache may hold at once

Syntax

property ThumbnailCacheMaxEntries: Integer; // read and write, default 64

Description

The cache stores embedded previews obtained through ExtractThumbnail and rendered previews obtained through RenderPageThumbnail behind a single least-recently-used policy, and this property caps how many entries survive, counting both bitmap entries and cached negative entries that remember the absence of an embedded /Thumb

Retention requires this ceiling and ThumbnailCacheMaxBytes to both be positive; an entry is kept only whilst both ceilings permit it

Reducing the value evicts the least recently used entries immediately, and each dropped entry grows EvictionCount in ThumbnailCacheStatistics

Remarks

Setting the ceiling to zero disables retention whilst leaving extraction and rendering fully available; every lookup then counts as a miss

Negative values raise EPdfError

The property is guarded by the render lock used by native PDFium page access, so changing it waits briefly for in-flight rendering

Example

Pdf.ThumbnailCacheMaxEntries := 128;
Pdf.ThumbnailCacheMaxBytes := Int64(96) * 1024 * 1024;

See Also

ThumbnailCacheMaxBytes, ThumbnailCacheStatistics, ClearThumbnailCache, Thumbnail cache