PDFiumPas 文件

AsyncRendering 屬性

元件: TPdfView  ·  單元: PDFium
選擇性啟用的旗標,讓檢視器在長時間轉譯期間畫出一個小型「Loading...」覆蓋層,方便採用自有背景工作者的應用程式維持一致的視覺提示

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