Reusable renderer backed by one Worker or main-thread WASM context.
Create instances with createRenderer. Fonts and execution mode belong to
the renderer lifetime; each returned PdfDocument has its own shorter
lifetime. Call dispose when the renderer is no longer needed.
Signature
export declare class Html2RealPdfMethods
render()
Snapshots browser state and renders one PDF.
render(source: HtmlSource, options?: RenderOptions): Promise<PdfDocument>;Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source | HtmlSource | Yes | None | HTML string, mounted element, or ref-shaped value to render. |
options | RenderOptions | No | {} | Options for this operation. |
Returns
Promise<PdfDocument>Errors
InvalidSourceErrorwhen a ref is null or the source shape is invalid.UnsupportedCssErrorwhen strict CSS or fallback policy rejects input.ResourceLoadErrorwhen required resources cannot be materialized.
dispose()
Terminates the owned backend and rejects future renders.
dispose(): void;Parameters
This API does not accept parameters.
Returns
void