You can create a canvas element programmatically using JavaScript and then apply its attributes as per your requirements. Here's the code to create a black canvas with dimensions 10x165mm:
index.tsx546 chars17 lines
Note that the size of the canvas might not be exactly 10x165mm due to varying screen densities.
gistlibby LogSnag