Like generating invoices. LaTeX could be a solutions, but since it's rather slow I would have to build a queuing system around it... Maybe there is already some neat service out there, that does this?
I inherited a codebase that uses this approach. You can use xvfb to get around the x11 frame buffer requirement. It works, but we are looking to migrate to another solution, since it appears that wkhtmltopdf is no longer maintained.
Wow this is so cool! Not sure it will fit my use-case, since I am still looking for something that can handle proper typesetting. But I bookmarked this - very handy!
You need to at least tell us what your backend is.
Have you googled your question yet? Is there an issue with the solutions you did find? Why would you want an external service? You could be exposing private info using external services.
Yes, I googled >.>; The question was asked openly by intend, since I don't care which backend technology such solution might use. I want an external service, since I do not want to set up stuff like a LaTeX runner myself and handling faults, scaling etc. Fair point with the private info though!
This looks incredibly interesting. I have previously used the free version of Reportlab, but this templating system would be significantly easier than futzing with the Reportlab DSL.
ReactPDF (https://react-pdf.org/) if:
a) React is an option
b) you (can) use nodejs on backend
c) PDF preview is required on frontend (optional)
d) you need to generate same PDFs on backend (optional)
We use PDFlib, but we started using it a long time ago when there wasn't a lot of good open source options for building pdfs. PDFlib isn't open source or free. So far PDFlib has worked well and not been so expensive that we've needed to look for anything else.
32 comments
[ 4.0 ms ] story [ 33.3 ms ] threadOtherwise perhaps you can find some language specific libraries, like the python based one mentioned above.
You can also use puppeteer or playwright to create pdfs from web pages.
1. Render html (easy with a templating language e.g. Jinja for Python)
2. Turn the html into a pdf (e.g. wkhtmltopdf in Python)
If you are using Linux, it is probably a package in your distro.
https://linux.die.net/man/1/pdftk
The homepage for the free (server) version.
https://www.pdflabs.com/tools/pdftk-server/
Per *NIX philosophy, that would be a separate tool in a pipeline.
Troff perhaps?
But, this starts to look like a hire a consultant problem where paying for expertise is more effective than learning through mistakes.
Because PDF does not imply typesetting…or layout which is a third thing technically.
Or “proper typesetting” which is another layer of craft. Which you might have staffed, and if so those are the people to talk to for recommendations.
Have you googled your question yet? Is there an issue with the solutions you did find? Why would you want an external service? You could be exposing private info using external services.
You could run pandoc in a lambda perhaps?
I haven't used it, but it looks promising. You create templates based on html (Handlebars templates), which should make it easy to get started.
https://github.com/navikt/pdfgen
It may be worth a look
https://www.pdflib.com/
If you can use NodeJS on your backend, you might want to take a look at my PDF Library: https://github.com/DevLeoko/painless-pdf