LibreOffice also can be used headlesslsy to convert other files to PDF locally. We use it via a container to first generate well-styled docx files (letters, invoices etc) and then convert those to PDFs.
https://gist.github.com/eugene1g/74172a761e604d875a59774189a...