Ox Content

renderer.ts

Source

wrapHtml

function

Wraps template HTML in a minimal document with viewport locked to given dimensions.

Source

function wrapHtml(bodyHtml: string, width: number, height: number, useBaseUrl: boolean): string

Returns

string -


renderHtmlToPng

function

Renders an HTML string to a PNG buffer using Chromium.

Source

Parameters

Name Type Description
page unknown Playwright page instance
html unknown HTML string from template function
width unknown Image width
height unknown Image height
publicDir unknown Optional public directory for serving local assets (images, fonts, etc.)

Returns

unknown - PNG buffer