For a little project of mine I had to generate PDF files from a fairly complex HTML web page.
After many tries the only library working fine was WeasyPrint. You can use in your Python projects or from the command line.
weasyprint https://napolux.com output.pdf
Perfect output and small PDF size. Give it a try!