When I added an "A4" preset to a browser-based collage tool, I thought the hard part was the layout maths. It wasn't. The hard part was that "A4" on a canvas is a shape, not a size — and if you don't say that out loud, your users find out at the print shop.

Here is what I got wrong, and the numbers that matter.

A canvas has no physical size

An HTML canvas is a pixel grid. It has width and height in pixels and nothing else. Paper has millimetres. The bridge between them is DPI, and the canvas has no opinion about it.

So when a preset says "A4", all it can honestly promise is the aspect ratio — 1:1.414, the ratio every ISO 216 paper size shares. What those pixels become on paper depends entirely on how many of them you exported.