HTML to Image
AI-generatedSummary
Render supplied HTML in a Puppeteer browser and return a PNG or JPEG screenshot as binary data. Set the viewport, optional base URL and background, and whether to capture the full page; the operation processes each input item independently.
Inputs
- HTML 内容 (htmlContent) (required) — HTML source to render, including any inline styles and resources.
- 资源基准地址 (baseUrl) — Base URL for resolving relative resources in the HTML.
- 页面宽度 (imageWidth) and 页面高度 (imageHeight) — Viewport dimensions in pixels; full-page capture can extend beyond the initial height.
- 清晰度倍率 (deviceScaleFactor) — Device scale factor for the viewport and screenshot.
- 全屏截图 (fullPage) (required) — Capture the full page when enabled, or only the viewport when disabled.
- 渲染等待延时 (renderDelay) — Extra delay in milliseconds after HTML loading before capture.
- 设置页面背景 (enableBackground) and 背景颜色 (backgroundColor) (required) — Optionally set the document body's background color; the color field is shown when background setting is enabled.
- 输出文件名 (fileName) and 图片格式 (imageFormat) — Output name without an extension and format, PNG or JPEG. The operation appends .png or .jpg.
- Options — Browser configuration including batch size, remote WebSocket endpoint or local executable path, device emulation, extra headers, launch arguments, timeouts, caching, headless mode, stealth, proxy, and container launch arguments. Several options are shared with other operations and do not affect HTML rendering.
Output shape
One item per input item, containing JSON metadata and binary image data under the data property.
JSON includes
fileNameandmimeType; binary data uses the same filename and MIME type. Browser or rendering errors are raised as node errors, or returned as error items when Continue On Fail is enabled.