DEV Community

Deepika Sharma
Deepika Sharma

Posted on

Django rest framework PDF generator

Anyone know how to export Django models to pdf format in Django admin panel. We all know how to export data in admin panel as CSV format. But there are not a clear file or sample to export as PDF. If anyone know how to do that please help.

Top comments (4)

Collapse
 
kirschd profile image
kirschd

Hi, if you look in the official docs, there is a section on how to output PDF files dynamically using Django views, using the open-source ReportLab Python PDF library. This is for Django3 docs:
docs.djangoproject.com/en/3.0/howt...

Collapse
 
deepikasharma5 profile image
Deepika Sharma

I tried to do with this document but it is not working in the admin panel..

Collapse
 
muhamma73752573 profile image
MUHAMMAD UMER

I'm looking to generate pdf with a third party library
I use docxtopdf

Collapse
 
corentinbettiol profile image
Corentin Bettiol

You can also use weasyprint to generate PDF files :)