Unable to integrate pdfkit for client-side PDF rendering. How to configure rollup?

Hi, I tried for two full days to get things running, but I cannot get my stencil app successfully compiled when trying to use pdfkit and blob-stream for pdf generation.

I set up a kind of minimal example for describing the problem: https://github.com/dSeidel/pdfkit-minimal.

Currently, I can use pdfkit on the server-side, i.e., in my project I made some test cases for manually rendering and storing pdfs on the server. Everything is fine, but as soon as I add some button to my app that should trigger rendering on the client-side, the app does not compile (that’s what the minimal example should make clear). And then the I can only get from one problem to the next.The readme.md and the commit history document the - in my opinion - most promising iteration on build trys.

I’d be glad if someone would have a solution for me. I also tried to not package pdfkit and blob-stream and serve it standalone via the assets folder, but in this case I struggle to use it in my components. If compilation is not possible at all, maybe someone could hint me on how to succeed this way.

Best, Daniel.

Have you looked into pdfMake?


We use it for client-side pdf report generation, works well for us within a larger StencilJS project.