Rendering Diagnostics and Operation Telemetry

HotPDF distinguishes rendered-page cache entries by every caller-visible state that can change page pixels and exposes bounded diagnostics when page content cannot be rendered completely

State-aware cache variants

THotPDF.RenderLoadedPageToBitmapCached keys memory entries by page, DPI, effective optional-content visibility, THotPDF.RenderColourIntent, and THotPDF.RenderFallbackPolicy

The persistent cache uses the same state digest, while diagnostic-producing fallback modes remain memory-only so a disk hit cannot lose skipped-object reports

Changing an optional-content group selects another variant instead of deleting the previous bitmap, so switching a layer or colour intent back can reuse earlier work

Colour intent

PDF.RenderColourIntent := rciRelativeColorimetric;
Bitmap := PDF.RenderLoadedPageToBitmapCached(0, 144);

rciDocument honours each content-stream ri operator and remains the default

The four explicit values override content-stream intent selection and are applied to subsequent ICCBased fill and stroke conversions

Fallback policy

PDF.RenderFallbackPolicy := rfpReport;
PDF.RenderFallbackDiagnosticLimit := 256;
Bitmap := PDF.RenderLoadedPageToBitmap(0, 144);
Diagnostics := PDF.GetLastRenderFallbackDiagnostics;

THotPDF.GetLastRenderFallbackDiagnostics returns the retained set, while THotPDF.ClearLastRenderFallbackDiagnostics clears it; cached report-mode entries retain their diagnostic set, so a memory cache hit returns the same rendering completeness information as the original render

Unified operation telemetry

if PDF.GetLastOperationTelemetry(Info) then
begin
  WriteLn(Info.OperationName);
  WriteLn(Info.ElapsedMilliseconds);
  WriteLn(Info.PeakMemoryBytes);
end;

THotPDF.GetLastOperationTelemetry returns a THPDFOperationTelemetry record containing elapsed time, peak component-retained memory plus the largest decoded filter chain, decoded bytes, cache hits and misses, object count, success, and cancellation

Document loading, synchronous and cached page rendering, progressive render slices, and selective stream optimisation publish the same record shape

PeakMemoryBytes is a portable document-operation estimate rather than the operating-system process working set, so it remains stable across hosts and includes loaded source bytes, rendered bitmap entries, decoded-image cache weight, and peak filter-chain storage

Related APIs