Mermaid diagrams can now be rendered to PNG on the server, not only to SVG. The addition targets a concrete limitation: PDF report generation embeds raster images more reliably than inline SVG, so diagrams authored in Mermaid now survive the path into a pixel-perfect document.
Rendering pipeline
- PNG alongside SVG. The Mermaid execution path returns either output form through a single result type, so a caller requests PNG or SVG without a separate code path.
- Report embedding. The PDF pre-processor now embeds Base64-encoded PNGs for Mermaid graphs in place of generated SVG, keeping rendering consistent across the document toolchain.
Exposed as a service
- gRPC transform call. A new
TransformMermaidToPNGremote call, defined in the microservices protocol, renders a diagram to PNG out of process and returns the encoded image. - Aligned protocol contract. The protocol adds a dedicated PNG response message, so the encoded bytes travel over the same gRPC contract as the existing diagram transforms.
SVG output is unchanged for callers that prefer it; PNG is an additional option chosen at the point of rendering.