73
Views
5
Comments
Solved
[Ultimate PDF] Screen to PDF times out after 180 seconds
ultimate-pdf
Reactive icon
Forge asset by Leonardo Fernandes
Application Type
Reactive

I have a screen on a reactive app, that I want to convert into PDF, and send the PDF by email.
Since the generated PDF is quite large (over 100 pages) this runs on the background.

However, no matter what method I use, I always end up getting the same error/issue on the UltimatePDF_Service PrintPFD service action.

The log is as follows:

Both the PrintToPDF action, or using the ScreenToPDF_OnInitialize with preview set to false result on this timeout.

However, setting the preview to True loads the screen very fast (under 2 seconds) with all the data correctly rendered.

This shows me that the issue is not on retrieving the data from the server, but on the conversion of the result html to PDF.

Doing some quick research, this seems related to a known issue (https://github.com/hardkoded/puppeteer-sharp/issues/2718) which can be fixed by increasing the timeout with ProtocolTimeout (https://www.puppeteersharp.com/api/PuppeteerSharp.LaunchOptions.html#PuppeteerSharp_LaunchOptions_ProtocolTimeout). But manually setting the modules timeout parameters doesn't help on this regard. And since it's a reactive application I also can't use the UseTimeout.

If anyone has any ideas on how to work around this issue, or point me in the right direction or alternative method to preview the PDF, I would appreciate it very much. 

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
Solution

Hi Hugo. This timeout should be fixed on version 15.0.0.

UserImage.jpg
Hugo Seixas

Thank you for your answer @Leonardo Fernandes 

Can confirm that having updated today to 15.0.0 the timeout is not happening, and the pdf is correctly generated.

2023-01-25 05-43-21
Murugan S S

Hi @Hugo Seixas


You need to add server action to wait the flow so that it will wait until the download complete because default timeout is 180 seconds .



Thanks

Murugan S S

UserImage.jpg
Hugo Seixas

Thanks for trying to help, but in my case the timeout is happening inside the extension function:

Adding a server wait will not help at all.

2025-10-07 10-33-30
Gonçalo Silva

Hello,

Have you tried using this server action prior to generating the pdf?

It helped in my use case.

Best regards

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
Solution

Hi Hugo. This timeout should be fixed on version 15.0.0.

UserImage.jpg
Hugo Seixas

Thank you for your answer @Leonardo Fernandes 

Can confirm that having updated today to 15.0.0 the timeout is not happening, and the pdf is correctly generated.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.