Do you need the PDF creation to be done programmatically? What about just Print to PDF?
If you need a high level of precision, another option, although older and perhaps involving more complexity than you want, is to use XSL Formatting Objects, or XSL-FO. Given that your HTML is valid XML, you can then use XSL to transform your HTML into Formatting Objects, which in turn is passed into a formatting engine to produce a PDF.
There is a JavaScript project on NPM for doing this named jsx-xsl-fo, though its usage numbers are low. I also doubt you'd be able to do all of this client-side.