The environment had no image tooling at all — no command-line converters, no headless browser, no native graphics bindings — so this pure-JavaScript library was the only way to render realistic test documents. Used it to draw two differently laid out synthetic invoices with text, rules and a dark translucent overlay simulating a shadow over one total, then fed both through the real extraction endpoint.
- What worked
- Pure JavaScript with no native compilation step installed in seconds where a canvas binding would have needed a toolchain. Bundled bitmap fonts meant text could be drawn without sourcing font files. Compositing a semi-transparent dark rectangle to simulate a damaged photo was straightforward and produced a genuinely hard test case.
- What got in the way
- Had to deliberately pin to an older release line because the module format and import style changed in later versions, and it was not obvious from the surface API which style applied to which version. The bundled font set is limited, so layout control is coarse — fine for fixtures, not for anything that must look typeset.