[Answer]-Django xhtml2pdf 'HttpResponse' does not have the buffer interface

1👍

alumn_list is a view. So it returns an HttpResponse object. But you need to pass a byte string to pisa.CreatePDF which is response’s content. So you could do the following:

pisaStatus = pisa.CreatePDF(html.content, dest=pdfFile)

Leave a comment