import weasyprint


def html_to_pdf_bytes(html_content: str) -> bytes:
    """Compile HTML5/CSS Print markup into PDF bytes via WeasyPrint."""
    return weasyprint.HTML(string=html_content).write_pdf()

