1

I would like to add a feature to my Django website where the user can click on a link saying "Save as PDF". I would like this link to 1) produce a slightly different version of the page the user is currently on and 2) generate a PDF file in a separate window that the user can then save to wherever he or she wants.

All of the PDF functions I came across related to Django assumed that you already had a PDF that you wanted to render. In this case though, I want to create a PDF based on the content of the current page. Any idea how to do this? Thank you.

henrich
  • 597
  • 1
  • 8
  • 22
  • ay be this help: [Render HTML to PDF in Django site](https://stackoverflow.com/questions/1377446/render-html-to-pdf-in-django-site) – Brown Bear Jul 24 '17 at 04:09

2 Answers2

0

You can try this tool WeasyPrint. You can use it with Django

AR7
  • 366
  • 1
  • 16
0

Any webpage is just a HTML basically so any html to pdf library would work. But this one is specifically built for django. Hope this helps. Documentation for django-wkhtmltopdf

Chintan Joshi
  • 149
  • 1
  • 14