PdfPageTextCache class

A persistent cache of extracted page text, on top of a PdfDiskCache.

Text extraction interprets the whole content stream (the same heavy walk that rendering does), so search, selection, and the reading view pay it again on every reopen of a document. This memoizes the result keyed by document content + page index, so a previously-opened document's text is read back from the store instead of recomputed.

Use a dedicated PdfDiskCache namespace (e.g. 'pdftext') so the text blobs and any page rasters age out independently. Bump the disk cache's version when the extraction logic changes meaningfully.

Constructors

PdfPageTextCache(PdfDiskCache cache)

Properties

cache → PdfDiskCache
The byte store this cache persists into.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

get(String documentKey, int pageIndex, FutureOr<PdfPageText> compute()) Future<PdfPageText>
Returns page pageIndex's text for the document identified by documentKey (e.g. pdfContentKey of the bytes, or a file path), reading it from disk on a hit and falling back to compute — caching the result — on a miss.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited