I’m trying to convert a .txt file to a .pdf file, but I’m facing this problem
def txttopdf(request): if request.method == ‘POST’: txt = request.FILES[‘txt’] pdf = fpdf.FPDF() pdf.add_page() pdf.set_font(“Arial”, size=12) pdf.cell(200, 10, txt.read().decode(‘utf-8′), 0, 1) return HttpResponse(pdf.output(dest=’S’), content_type=’application/pdf’) return render(request, ‘txttopdf.html’) I create the pdf file but I cannot view its content. I’m trying to convert a .txt file to a .pdf file, but I’m facing this problem. python django […]