将django中的模板html转换为pdf并下载

Convert template html in django to pdf and download it

如何使用 Django 在我的网页上创建一个按钮,将页面转换为 PDF 并下载?

试试这个。

...本文档介绍了如何使用 Django 视图动态输出 PDF 文件。出色的 open-source ReportLab Python PDF 库使这成为可能。

https://docs.djangoproject.com/en/4.0/howto/outputting-pdf/

https://www.reportlab.com/dev/install/open_source_installation/