The big limiting factor with all of the open-source PDF-writing libraries (f.e. PDFKit and libHaru) is that none of them support groups or transparency groups. Vector graphics involves layers and blending, referencing large amounts of geometry multiple times for blurs, and without this support, then you can't really export documents of significant complexity. Any plans to work on this? It's all in the 1.4 spec, so I anticipate I'll just have to implement it myself. It's rather daunting unless you understand the graphics stack well, since pushing a PDF group or transparency group resets some aspects of the stack.
I implemented functions for groups: PDFGroup.js. Once a group is created content can be added inside it with the classic PDFKit functions. Groups can be drawn on the page or used as a mask.
However there are serious limitations
in case anyone else is looking for that file, here's the archive link: https://github.com/alafr/SVG-to-PDFKit/blob/39c9faf32fd906bdac1eb7436fac600af54969de/PDFGroup.js
Most helpful comment
I implemented functions for groups: PDFGroup.js. Once a group is created content can be added inside it with the classic PDFKit functions. Groups can be drawn on the page or used as a mask.
However there are serious limitations