PDFium Component Docs

AsyncRendering property

Component: TPdfView  ·  Unit: PDFium
Cờ opt-in yêu cầu view vẽ một lớp phủ nhỏ "Loading..." trong lúc render dài để các ứng dụng tự dùng worker riêng cho render ngoài thread vẫn có cùng một dấu hiệu trực quan

Syntax

property AsyncRendering: Boolean;

Description

AsyncRendering is the visual half of the async render pattern: it tells the single-page paint path to draw a small loading indicator (configured through LoadingText and LoadingColor) over the rendered page area while a caller-owned worker renders the current page. The default is False so existing applications upgrade with no visual change.

AsyncRendering does not push rendering onto a worker thread by itself. Since v1.37.0, TPdf serializes render and page-unload calls per instance, so a worker can render through the same component without overlapping PDFium render calls. The caller still owns worker dispatch, bitmap handoff, and document lifetime: do not mutate or unload the document while a render is in flight. Use TPdfFuture<T> from FPdfAsync to drive the worker, and let AsyncRendering / LoadingText / LoadingColor handle the visual affordance during the in-flight render.

The loading overlay is a small rectangle drawn in the center of the page area, sized to the LoadingText caption. Applications that need a different placement, animation, or progress percentage should keep AsyncRendering off and handle the overlay through OnPaint directly.

Remarks

Example

PdfView1.AsyncRendering := True;
PdfView1.LoadingText := 'Rendering...';
PdfView1.LoadingColor := clGray;

// Kick off the actual off-thread render with TPdfFuture (FPdfAsync).
// The worker owns its own TPdf — DO NOT share PdfView1.Pdf.

See Also

LoadingText, LoadingColor, RenderPage