Renders with a lazily created package-default Worker renderer.
The default renderer is cached for the application lifetime and cannot be
configured with custom fonts. Use createRenderer when deterministic
backend disposal or renderer-level configuration is required. The returned
document must still be disposed by the caller.
Signature
export declare function renderPdf(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>Example
const pdf = await renderPdf(document.querySelector("#invoice")!);
try { pdf.download("invoice.pdf"); } finally { pdf.dispose(); }