I would use pandoc and convert to pdf using typst:
```
pandoc input.html -t typst -o output.typ
typst compile output.typ output.pdf