Skip to content

PngExporter

Defined in: src/exporters/PngExporter.ts:36

PngExporter - Converts SVG to PNG.

Defaults to resvg, a native, browser-free rasterizer. Pass engine: 'html-to-image' to opt into the Puppeteer-based fallback engine instead.

Note: neither engine fetches external images (like AWS service icons from a CDN) itself - exportPng (the sfn-diagram/png subpath) inlines them as data URIs first via embedIcons when showIcons is set and the engine is resvg. A caller using PngExporter directly must do the same.

new PngExporter(options): PngExporter;

Defined in: src/exporters/PngExporter.ts:39

PngExporterOptions

PngExporter

convert(params): Promise<PngOutput>;

Defined in: src/exporters/PngExporter.ts:46

Convert SVG string to PNG buffer

ConvertParams

Promise<PngOutput>