HTML ??? ??? ?? PDF ??? ???? ????
??? weasyprint? ???? ??? ????? ???? ?????
?? ??? ??? ??? ????
?????? HTML ??? ?? PDF ??? ??? ???? ????
??? ??????
?????? ??? ?? ??? ??????
def pdf_generate(): try: pdf_file = HTML(string='56129.html').write_pdf() with open("my_pdf_file.pdf", 'wb') as f: f.write(pdf_file) except Exception as e: print(str(e)) return None
HTML ??? ???? ?? HTML(string=html_string).write_pdf()
???? ???? ???.
?, ?? ????? ?? ????? HTML(filename=html_file_path).write_pdf()
???? ???? ???.
??? ??? ????.
???