-
Weasyprint only gives me empty pdfs when I'm trying to print newsarticles
almost 8 years ago
-
almost 8 years ago
Hi peterjnielsen.
First you have to install reportlab in your system then follow the below code .
pip install reportlab
then you have to add python packages..import reportlab def pdf_view1(request1): f1 = FileSystemStorage1() filename = 'mypdf.pdf' if fs.exists(filename): with f1.open(filename) as pdf: response = HttpResponse(pdf, content_type='application1/pdf1') response['Content-Disposition'] = 'attachment; filename="mypdf.pdf1"' return response else: return HttpResponseNotFound('The requested pdf was not found in our server or can not find .')
-
1 Answer(s)