Verified Commit f5f38472 authored by Jakob Moser's avatar Jakob Moser
Browse files

Add basic HTML to PDF conversion step

parent 62613d63
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
from weasyprint import HTML


def html_to_pdf(html: str) -> bytes:
    """
    Use weasyprint to convert the given HTML string to a PDF
    """
    return HTML(string=html).write_pdf()