PDFium Delphi Component Docs

ReadableContentCacheCapacity property

Component: TPdf  ·  Unit: PDFium
property ReadableContentCacheCapacity: Integer;

Sets the retained-page limit from 0 through 64, default 8; zero disables retention and lowering the value trims the LRU entries immediately

Shared readable-content cache

TPdf.ReadableContent, ReadablePageContent, DocumentReadableContent, their reading-unit helpers and a bound TPdfView.ReadableContent share the per-page managed snapshots

On a hit, the resolved fragments are reused, including the MCID text and geometry, without rebuilding the readable MCID map or opening a native text page

The default limits are 8 pages and 8 MiB of estimated retained managed data; pages are evicted least-recently-used first and also count towards the document's total CacheBudgetBytes as pckReadableContent

Each result owns its fragment array, LineRects and MarkedContentIDs; changes made by the caller cannot modify the retained snapshot

Notified content edits, structural changes, document-language changes, deactivation and replacement clear the retained data; raw native mutations still require the usual UpdatePage notification

Cross-page reads use transient native handles and preserve the document page, viewer page, native focus and pending edit buffer; cache entries hold no native handles

Oversized results, disabled retention, global-budget rejection and incomplete bounded structure traversal return the current full readable result without retaining it; native read failures propagate and are never cached

Readable reads are rejected whilst a page-object edit transaction is active; call after commit or rollback

Limits account for conservative managed-data charges and place no bound on parser/transient allocations, returned caller copies, whole-process memory or execution time

A working set larger than the configured capacity can evict earlier pages during a document scan; the cache statistics report lifetime hits, misses, evictions and bypasses, including across clears

ReadableContentCacheCapacity, ReadableContentCacheMaxBytes, ReadableContentCacheStatistics, ClearReadableContentCache