This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Unable to generate PDF output

prismforimpact wrote on 2017-06-01:
I'm getting 502 - Sorry, we couldn't process your request. please help me out its so urgent !
url :

code used to configure :

def generate_pdf_view(request):
if request.user.groups.filter(name='Small-Enterprises'):
paths = path = request.GET.get('paths', None)
path = request.GET.get('path', None)
if request.user.groups.filter(name='Small-Enterprises'):
if paths:
html = "<div>%p/%n</div>"

pdf = client.convertURI(paths)
response = HttpResponse(content_type="application/pdf")
response["Cache-Control"] = "no-cache"
response["Accept-Ranges"] = "none"
response["Content-Disposition"] = "attachment; filename=prismforimpact_com.pdf"

response = HttpResponse(content_type="text/plain")
response.write("No Report Fo
except pdfcrowd.Error, why:
response = HttpResponse(content_type="text/plain")
return response
support wrote on 2017-06-05:

Our system is unable to convert the page to PDF in under 40 seconds which is the hard limit for PDF processing on our end. In cases like this we recommend that you split the input HTML code into smaller chunks, convert each separately and then join the PDFs together using a third party tool. We frequently use and can recommend a command line tool called pdftk.