App stuck in PDF creation process, process takes too long

What I’m trying to do:
I have a dashboard from which I would download a PDF. The problem is that whenever I click my button to download, it gets stuck in the loading process. When I stop the app and try again, I get the following error:

Exception: PDF generation failed: Components did not load within allowed time.
at /downlink/anvil/pdf.py, line 17
called from /downlink/anvil/pdf.py, line 47
called from [ServerModule1, line 527]
called from /downlink/anvil/_server.py, line 41
called from [ServerModule1, line 493]
called from [Report, line 45]

What I’ve tried and what’s not working:
I have tried the offered solutions in this question, but they do not work:

Steps to reproduce problem:

  • Login using:
  • Choose the only available options in the dropdown lists
  • Click “Toon dashboard” (This will take a while)
  • Scroll to the bottom of the page and click “Download Rapport”

Clone link:

It looks like the PDF renderer is taking too long.

This could help: Generate PDF-Report (too slow)

1 Like

Hi @devops,

We where also in need of fast printed reports (100s of pages) and are quite happy with fpdf2.

This is by far not as convenient as anvil pdfs and possibly not suited for your usecase but very fast and installed on anvil servers.

If you want them ‘instantly’ (although the RTT for such a task is usually not that long) you could also use a client side JS library to print PDFs.
We use it for cases where we need offline capability: jsPDF - HTML5 PDF Generator | Parallax

3 Likes