Display Lists and Print Production
HotPDF compiles loaded page streams into reusable THPDFPageDisplayList instances with THPDFDisplayListInfo metrics and content-object bounding boxes
Document rendering caches compiled lists, while callers can request an independently owned list for repeated execution or regional object queries
Shared production interpreter
Non-progressive bitmap, direct-DC, Form and display-list replay all pass pre-tokenized content through HPDFInterpretContentTokensDevice, which owns operator traversal and cancellation boundaries
THPDFPageRenderer implements IHPDFContentOperatorDevice, so the shared traversal invokes its complete graphics, text, resource, clipping, pattern, transparency, marked-content and image state machine without reducing production rendering to the smaller semantic callback surface
Display lists cache operator token indexes while streams are compiled and replay only those indexes, avoiding repeated operand scans; THPDFPageDisplayList.OperatorCount and THPDFDisplayListInfo.OperatorCount expose the cached command count
Semantic devices that implement only IHPDFContentDevice retain capability-filtered callbacks, while complete operator devices receive one validated operator at a time with one cancellation checkpoint per operator
Bounded and concurrent rendering
THPDFRenderTileEvent receives one caller-sized tile or horizontal band at a time, keeping peak raster memory independent of full page size
RenderLoadedPagesParallel overlaps display-list compilation with playback, starts the first ready page without waiting for a full compile barrier, dynamically balances both stages across bounded workers, and returns a THPDFBitmapArray in input order
Compilation runs outside the display-list cache lock, while double-checked admission and protected use counts let unrelated pages compile concurrently without duplicating published entries or evicting a list during playback
THPDFParallelRenderPipelineInfo exposes cache hits, compilations, completions, peak compile and render concurrency, pages compiled at first result, first-result latency, and total elapsed time
RenderLoadedPagesParallelOrdered delivers callbacks in input order on the calling thread and releases each borrowed bitmap after the callback returns, while a caller-selected output depth applies producer backpressure and reserves one slot for the next required page so a slow early page cannot deadlock behind later results
Ordered streaming retains at most one display list and active render per worker plus the bounded completed-bitmap queue instead of keeping the complete job output resident
Pluggable render backends consume the same compiled lists through a non-owning document resource view, so synchronous and parallel paths avoid reparsing page content while backend capabilities determine whether calls may overlap or require serial dispatch
The process-wide peak-memory scheduler now limits both parallel APIs: the largest page estimate reduces the initial worker count, each claimed page reserves its complete estimated working set, and ordered output retains that reservation through callback delivery
Scheduler cancellation wakes budget waiters on callback cancellation or worker failure, while telemetry exposes requested versus effective workers, peak reservation weight, delayed pages, and aggregate wait time
RenderLoadedPageTilesParallel and RenderLoadedPageBandsParallel deliver borrowed row-major tiles or top-to-bottom bands across isolated workers while each worker owns at most one tile and a caller-supplied working-memory cap reduces concurrency before the first claim
Parallel render contexts copy immutable Type 3 glyph token sequences and halftone threshold screens from one bounded LRU cache, preserving renderer-local ownership for mutable graphics state and GDI resources
SaveLoadedPageToPng, SaveLoadedPageToPngStream, SaveLoadedPagesToTiffBanded, and SaveLoadedPagesToTiffStreamBanded consume the same band renderer through streaming PNG or TIFF encoders, so very large pages emit compressed output row by row without holding a complete framebuffer while THPDFBandImageExportInfo reports rendered bands, encoded rows, workers, peak reservation bytes, output bytes, elapsed time, and cancellation
Shared image decoding is coordinated separately so vector page work remains parallel without corrupting decoded-image cache entries
PrefetchLoadedPages warms raster entries with a dedicated cancellation token while compiling and rendering outside the cache lock, and foreground page rendering preempts the worker before starting latency-sensitive work
THPDFLoadedPagePrefetchInfo reports scheduled, started, completed, cached, rendered, failed, cancelled, and foreground-preempted work together with last and peak cancellation latency
Transparency and print controls
Transparency flattening first checks the display-list transparency count and a caller-defined pixel ceiling, then replaces page paint with a lossless Flate-compressed calibrated RGB image
Pages with Separation or DeviceN colourants remain as vector content, with the detected colourants and preservation status exposed to the caller
The renderer executes transfer functions and Type 1, 5, 6, 10, or 16 halftone dictionaries from ExtGState while preserving independent RGB screens and their transfer overrides through q and Q
THPDFInkCoverageInfo reports average CMYK coverage, maximum total area coverage and the number of pixels above the selected threshold
Process and spot plate output supports DeviceCMYK, Separation and DeviceN colourants
Loaded-page color rewrite uses the same complete renderer to convert complex pages to Gray, RGB, or CMYK while retaining simple device-color page content as vectors and applying an explicit spot-plate policy
THPDFTrappingInfo combines document trapping declarations, page metadata and TrapNet structural diagnostics
ICC workflow
The rendering transform can combine a PDF source profile, blend color space, proof profile, output profile and sRGB raster destination
All four ICC rendering intents and true black-point compensation are applied consistently to vector colors and image samples across the pipeline
Complete transforms are shared across vector, image, page and parallel rendering paths through a thread-safe 64 MiB LRU cache keyed by source, proof and output profile contents, effective rendering intent and black-point compensation
Transparency flattening reuses the same transform pipeline, then emits seam-free D65 CalRGB tiles under caller-controlled total-raster and per-tile pixel budgets
Primary APIs
- Pluggable render backends
IHPDFContentOperatorDeviceHPDFInterpretContentTokensDeviceTHotPDF.CompileLoadedPageDisplayListTHPDFPageDisplayList.GetTokenTHPDFPageDisplayList.GetObjectTHPDFPageDisplayList.QueryObjectIndexesTHPDFPageDisplayList.PageObjectTHPDFPageDisplayList.ResourcesTHPDFPageDisplayList.MediaBoxTHotPDF.RenderLoadedPageTilesandRenderLoadedPageBandsTHotPDF.RenderLoadedPageTilesParallelandRenderLoadedPageBandsParallelTHPDFParallelTileRenderInfoTHotPDF.SaveLoadedPageToPngTHotPDF.SaveLoadedPageToPngStreamTHotPDF.SaveLoadedPagesToTiffBandedTHotPDF.SaveLoadedPagesToTiffStreamBandedTHPDFBandImageExportInfoTHotPDF.RendererSharedCacheMaxBytesTHotPDF.RenderLoadedPagesParallelTHotPDF.RenderLoadedPagesParallelOrderedTHPDFParallelRenderPipelineInfoTHotPDF.PrefetchLoadedPagesTHotPDF.GetLoadedPagePrefetchInfoTHPDFLoadedPagePrefetchInfoTHotPDF.FlattenLoadedPageTransparencyTHotPDF.FlattenLoadedPageComplexGraphicsTHotPDF.RenderLoadedPageSeparationPlateTHotPDF.GetLoadedPageSpotColorantsTHotPDF.RewriteLoadedPageColorsTHotPDF.AnalyzeLoadedPageInkCoverageTHotPDF.InspectLoadedPageTrappingTHotPDF.ConfigureRenderICCWorkflow