code: def download(self, data, filename, content_type="application/pdf"):
          
          self.request.response.setHeader(
              "Content-Disposition", "inline; filename=%s" % filename)
          self.request.response.setHeader("Content-Type", content_type)
          self.request.response.setHeader("Content-Length", len(data))
          self.request.response.setHeader("Cache-Control", "no-store")
          self.request.response.setHeader("Pragma", "no-cache")
          self.request.response.write(data)
docs: Download the PDF