Hello I tried to generate pdf from my response like here
def index(request):
p = Popen(["prince","","out.pdf"], stdin=PIPE, stdout=PIPE)
template = loader.get_template('pdf/pdf.html')
response = HttpResponse(template.render())
p.stdin.write(response)
p.stdin.close()
pdf = p.stdout.read()
print pdf
print("PDF is "+str(len(pdf))+" bytes in size")
print response
return HttpResponse(template.render())
but I get this message "TypeError: must be convertible to a buffer, not HttpResponse
" what's it meaning? and how it solwed?
def index(request):
p = Popen(["prince","","out.pdf"], stdin=PIPE, stdout=PIPE)
template = loader.get_template('pdf/pdf.html')
response = HttpResponse(template.render())
p.stdin.write(response)
p.stdin.close()
pdf = p.stdout.read()
print pdf
print("PDF is "+str(len(pdf))+" bytes in size")
print response
return HttpResponse(template.render())
but I get this message "TypeError: must be convertible to a buffer, not HttpResponse
" what's it meaning? and how it solwed?