This is an archived forum post. The information may be outdated. Contact us if you have any questions.
def generate_report_pdf(request, user_id): import pdfcrowd try: # create an API client instance client = pdfcrowd.Client("shiva", "xxxxxxxxxxxxxxxx") # convert a web page and store the generated PDF to a variable pdf = client.convertURI("http://hello.t.proxylocal.com/assessment/overview/362/") # set HTTP response headers response = HttpResponse(mimetype="application/pdf") response["Cache-Control"] = "no-cache" response["Accept-Ranges"] = "none" response["Content-Disposition"] = "attachment; filename=com.pdf" # send the generated PDF response.write(pdf) except pdfcrowd.Error, why: response = HttpResponse(mimetype="text/plain") response.write(why) return response
510 - Timed out. Can't load the specified URL. List of the resources that can't be loaded: http://hello.t.proxylocal.com/media/assessment_report/images/362_2.png http://hello.t.proxylocal.com/media/assessment_report/images/362_4.png http://hello.t.proxylocal.com/media/assessment_report/images/362_3.png http://hello.t.proxylocal.com/media/assessment_report/images/362_5.png
Time Limit If a request takes more than 40 seconds to complete it is cancelled and either of these messages may be returned: 510 - 413 Timed out. Can't load the specified URL. 502 - Sorry, we couldn't process your request. A typical cause of this error is too many images on an HTML page which take too long to download. Another cause might be a long running JavaScript.