Render once, write many
The renderer builds one receipt layout, then sends it through PDF, PNG, and SVG backends so the formats stay aligned.
Case · Backend · Rendering
Receipts rendered from structured JSON to matching PDF, PNG, and SVG output.
Receipts need exact totals and matching output across PDF, PNG, and SVG.
Sole engineer
Shipped renderer with a shared core, golden-image tests, and architecture notes.
Receipts sound simple until totals, taxes, logos, fonts, and different output formats all have to match. I built a renderer that keeps the math exact and the visual output stable across servers.
The renderer builds one receipt layout, then sends it through PDF, PNG, and SVG backends so the formats stay aligned.
Amounts use `decimal` with explicit away-from-zero rounding from input parsing to the rendered total. No floating point is used for currency.
Logos and fonts are embedded rather than fetched at render time, which avoids SSRF risk and keeps output reproducible.
decimal RoundMoney(decimal amount)
{
return Math.Round(amount, 2, MidpointRounding.AwayFromZero);
}
A small rendering toolkit with the boring parts handled properly: exact money, stable output, and architecture notes explaining the main decisions.