Node canvas is a Cairo backed Canvas implementation for NodeJS
...When MIME data is tracked, PDF canvases can embed JPEGs directly into the output, rather than re-encoding into PNG. This can drastically reduce filesize and speed up rendering. If working with a non-PDF canvas, image data must be tracked, otherwise the output will be junk.