Scalable and Random-Access PDF Loading
HotPDF keeps large loaded files responsive by delaying stream copies and compressed-object parsing until the data is required
File-backed stream windows
Unencrypted documents opened with LoadFromFile retain immutable stream bodies as source-file ranges
Reads seek to the required range and release the source handle immediately, so the original file remains replaceable on Windows
The first write materialises the stream in memory when it is at or below LoadedStreamMemoryThreshold, or in an owned temporary file when it is larger
Lazy object streams
Each decoded /Type /ObjStm container is indexed by authoritative xref object number without parsing every member during open
Catalog, page-tree, and later link resolution materialise individual members once and reuse their parsed objects
A full rewrite automatically materialises every remaining member, whilst an unchanged file-backed save can preserve the original bytes directly
Custom random access
Derive from THPDFRandomAccessSource and implement GetSize plus ReadAt to load from HTTP ranges, databases, archives, or virtual storage
LoadFromRandomAccessSource adapts the source to HotPDF's seekable parser and can optionally own the source for the document lifetime
Diagnostics
GetLoadedStreamCacheInforeports source-backed, memory-materialised, and disk-materialised stream countsGetLoadedObjectStreamCacheInforeports indexed and materialised members, cache hits and misses, and retained decoded bytes
See also: LoadFromRandomAccessSource, LoadedStreamMemoryThreshold, DecompressAllObjectStreams