It is possible to inject HTML and/or JavaScript in the HTML to PDF conversion in Gotenberg up to and including 6.2.1 via the /convert/html endpoint.
thecodingmachine gotenberg