carboneio / carbone

Fast and simple report generator, from JSON to pdf, xslx, docx, odt...
https://carbone.io
Other
1.33k stars 196 forks source link

[Question]: Concurrency and HTTP API (express) for Carbone #141

Open mwllgr opened 3 years ago

mwllgr commented 3 years ago

Hi, has anyone here ever wrapped Carbone into an API with express? And how about concurrency: Can Carbon generate e.g. 30 PDFs per second when multiple requests come in?

I've never used node in production so I'm not an expert here. Would be grateful if someone has an answer! :)

mwllgr commented 3 years ago

Just an update here: I found a repository by @isaudits which seems to be useful: https://github.com/isaudits/docker-carbone - Will look into it.

loneil commented 3 years ago

It's worth noting that Carbone invokes LibreOffice to do the PDF conversion, so your architecture of how you host/setup Libre is going to be of importance here for high volume use. https://github.com/carboneio/carbone#pdf-generation-document-conversion

So while Carbone itself is just an NPM package you can include in a node API and all the regular considerations about threading and concurrency in a node/express JS app apply there, how Libre is invoked and resource managed will be the consideration if PDF conversion is done in a render.

fleebzz commented 1 month ago

Hi @mwllgr !

If you're still interested I have a Docker image publicly available I just updated to containerize Carbone and which provides an HTTP API in front of it: fleebzz/carbone.

If you use Node.js you can easily integrate this container with the carbone-connect NPM package