Earlier quoted context omitted.
Just use WkhtmlToPdf https://wkhtmltopdf.org and wrap a simple service around it.
wkhtmltopdf is a solid tool but its mostly abandoned now. rendering in chrome headless is way faster and more accurate. chrome headless though is lacking a lot of features that wkhtmltopdf provides like headers/footers
Headers/footers are 2 huge features. Plus all of the other small features wkhtmltopdf has. It may not have all the new bells and whistles but it works reliably.