exportPng
function exportPng(params): Promise<PngOutput>;Defined in: src/png.ts:47
Render an ASL definition directly to a PNG image.
Generates an SVG from the definition, then rasterizes it to PNG using the
native resvg engine by default. Runs on Node only.
Parameters
Section titled “Parameters”params
Section titled “params”ASL definition plus diagram, background, PNG engine, and font options.
Returns
Section titled “Returns”Promise<PngOutput>
The PNG buffer along with its dimensions and format metadata.
Example
Section titled “Example”const { buffer, width, height } = await exportPng({ aslDefinition: asl, backgroundColor: '#ffffff', scale: 2,});