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
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
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.
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.
Otherwise 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)
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?